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
665
Unable to set cell value client side
posted

Hi there

I am trying to keep track of modified rows of the WebDataGrid. The following discussion http://es.infragistics.com/community/forums/t/67651.aspx implies that IsDirty() method of GridRecord is not going to work. So to keep track of the modified values I have added a hidden data bound column to the grid – bound to ‘Status’ property of the record and implemented EditingClientEvents-CellValueChanging event handler on the client side. The event handler sets a value in the hidden column. On the server side, when a "Save" button is pressed on a form, I iterate trough the WebDataGrid rows, check the value of the ‘Status’ property and save the records that are added or modified.

The event handler for  CellValueChanging looks like this:

function updateEntityState_OnChange(sender, eventArgs) {

     for (i = 0; i < eventArgs._cell._row._element.cells.length; i++)

    {

        if (sender._columns._items[i]._key == 'Status') {           

             var status = eventArgs._cell._row._element.cells[i].firstChild.nodeValue;

             if (status == null) {

                eventArgs._cell._row._element.cells[i].firstChild.nodeValue = 2/*Added*/;

            }

            else if (status == 0/*Unchanged*/) {

                eventArgs._cell._row._element.cells[i].firstChild.nodeValue = 1/*Modified*/;

            }

            break;

        }

    }

}

 

The implementation above does not work. When I step though the code in the debugger everything looks fine but the when I check the row on a server a value in “Status” column is always 0.

 I have three questions here:

  1. What is a correct way of setting value of another cell from client side code?
  2. The use of underscored methods/properties in my code does not look right. When I tried to use more ‘civilized’ function call notation, (similar to http://es.infragistics.com/community/forums/t/44515.aspx) I am getting Object does not implement method errors. Am I missing some Infgagistics library/script that have cell.get_value() and cell.set_value() defined?
  3. Is there any way of making use of IsDirty() method of GridRecord object on a server side?

 

Thank you

 

Boris

 

Parents Reply Children