Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
215
ValueChanging event
posted

How do you use the ValueChanging event from inside an EditorProvider

I have defined an EditProvider

                        <ig:TextEditorProvider ID="tepPercent">

                            <EditorControl HorizontalAlign="Right" ClientEvents-ValueChanging="validatePercent4Decimals"></EditorControl>

                        </ig:TextEditorProvider>

 

And a javascript handler

            function validatePercent4Decimals(sender, args) {

                var oldfieldvalue = args.get_oldValue();

                var newfieldvalue = args.get_value();

                if (isNaN(newfieldvalue)) {

                    args.set_value(oldfieldvalue);

                    args.set_cancel(true);

                }

            }

 

I've debugged it and can see it is running, and if I enter 34r, the inNan tests true and the set_value and set_cancel are called. But the value on the grid does not change from the 34r...

 

What's going on?

Parents
No Data
Reply
  • 19693
    posted

    Hello bixbarton ,

    Thank you for posting in our forums.

    I tried to reproduce the issue with the latest service release of v11.1 ( 11.1.20111.2064) but with no avail.

    I strongly recommend you installing it.

    The newly entered value is removed and the old value is restored

       <EditorProviders>

                    <ig:TextEditorProvider ID="whdg1_TextEditorProvider1">

                        <EditorControl runat="server">

                            <ClientEvents ValueChanging="whdg1_TextEditor_ValueChanging" />

                        </EditorControl>

                    </ig:TextEditorProvider>

                </EditorProviders>

    …. 

     

     <ig:BoundDataField DataFieldName="ItemParent" Key="ItemParent" Header-Text="ItemParent">

                        <Header Text="ItemParent"></Header>

                    </ig:BoundDataField>

     

    ….

     

      <ig:CellEditing>

                                <ColumnSettings>

                                    <ig:EditingColumnSetting ColumnKey="ItemParent" EditorID="whdg1_TextEditorProvider1" />

                                </ColumnSettings>

                            </ig:CellEditing>

    What is the type of the column that you are setting the editor provider to?

    Hope hearing from you.

Children