[CLOSED] Need help in GridPanel Cell Validation (Server Side)

  1. #1

    [CLOSED] Need help in GridPanel Cell Validation (Server Side)

    Hi,

    I am trying to do a GridPanel cell validation using server side using GridPanel's DirectEvent->ValidateEdit. But, event though i set the DirectEventArgs e.Success = false and e.ErrorMessage to display the validation error message it is not displaying the message (i.e) not validating. Am i doing something wrong.

    Note: I want to dispaly the validation error simlar to the FormPanel validation error when the cell validation is failed.

    Please suggest the best way to do server side validation of a GridPanel cell.

    Regards,
    Manoj.
  2. #2
    ValidateEdit events expects immediate answer, it cannot work with async opertions
    You can pass all required info as extra parameters and revert the value manually if validation is not passed

    - pass value, originalValue, row index and field name to server with ValidateEdit direct event (if you have problems how to get value and original value then please 'validateedit' event description in ExtJS API Docs http://dev.sencha.com/deploy/ext-3.4...ditorGridPanel)

    - validate value and revert to old value if required
    GridPanel1.UpdateCell(rowIndex, dataIndex, originalValue);
  3. #3
    Hi Vladimir,

    After reverting the invalid data to original state how do i mark the cell as not edited because the cell shows a 'RED' icon on the top left corner.

    Regards,
    Manoj.
  4. #4
    Try this
    Store1.AddScript("{0}.getAt({1}).commit();", Store.ClientID, rowIndex);
  5. #5
    Hi Vladimir,

    If i add any script after the GridPanel.UpdateCell method i am getting a javascript error as follows:
    Note: Not able to show notification window or messagebox or even commit the cell as you mentioned

    "Microsoft JScript compilation error: Expected ';'"

    Below is the sample script it is trying to evaluate

    UserDashboardManagement_chkIsDefault.setVisible(!f alse);UserDashboardManagement_chkIsProject.setVisi ble(!false);Ext.Msg.show({title:"Validation Error",buttons:Ext.Msg.OK,msg:"Please enter valid title"});UserDashboardManagement_ucAssignCreateWid gets_gpWidgets.store.getAt(2).set("Title","MY Widget +++++++++++")UserDashboardManagement_ucAssignCreat eWidgets_WidgetsStore.getAt(2).commit();


    Note: I think it is missing the ";" after the "UserDashboardManagement_ucAssignCreateWidgets_gpW idgets.store.getAt(2).set("Title","MY Widget +++++++++++")"



    Regards,
    Manoj.
  6. #6
    Yes, it is a bug. We will fix it
    Please use store method instead grid's 'UpdateCell'
    Store1.UpdateRecordField(rowIndex, dataIndex, value) ;
  7. #7
    Hi Vladimir,

    Store1.UpdateRecordField(rowIndex, dataIndex, value) ;
    The above code is working fine. Thank you.

    Regards,
    Manoj

Similar Threads

  1. Replies: 12
    Last Post: Jun 05, 2011, 8:08 PM
  2. GridPanel Cell Value at Server Side
    By Ganesh3.shirsath in forum 1.x Help
    Replies: 1
    Last Post: Sep 29, 2010, 3:01 PM
  3. Client & Server Side Control Validation
    By r_honey in forum 1.x Help
    Replies: 3
    Last Post: Dec 27, 2009, 5:16 AM
  4. Server side validation
    By bobs in forum 1.x Help
    Replies: 1
    Last Post: May 06, 2009, 5:45 PM
  5. Server-side Validation
    By davidhoyt in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Dec 23, 2008, 6:31 PM

Posting Permissions