jQWidgets Forums

jQuery UI Widgets Forums Grid Dirty Flag in JqxGrid

This topic contains 4 replies, has 3 voices, and was last updated by  shylu 8 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Dirty Flag in JqxGrid #57263

    yaohancz
    Participant

    Hi, I’m trying to implement dirty flag on my grid. Here is my code:
    {text: ‘Arrived Late(min)’, columntype: ‘textbox’, width: ‘10%’, datafield:’ArrivedLateMinutes’,
    cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
    $(“#grid”).jqxGrid(‘beginupdate’);
    $(“#grid”).jqxGrid(‘setcellvalue’, row, ‘_isDirty’, true);
    $(“#grid”).jqxGrid(‘endupdate’);
    if (newvalue == “”) return oldvalue;
    }
    }

    However when I put the setcellvalue code, if I want to finish editing by clicking on other cell/outside the grid, the cell couldn’t move to another cell (still editing). Is there any other way to do it?

    Dirty Flag in JqxGrid #57267

    Peter Stoev
    Keymaster

    Hi yaohancz,

    You can use the “endcelledit” method to end the cell editing in the Grid.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Dirty Flag in JqxGrid #57272

    yaohancz
    Participant

    I’ve tried to use that but the result is still the same.

    			$("#grid").bind('cellendedit', function (event) {
    				var args = event.args;
    				var columnDataField = args.datafield;
    				var rowIndex = args.rowindex;
    				var cellValue = args.value;
    				var oldValue = args.oldvalue;
    				$("#grid").jqxGrid('beginupdate');
    				$("#grid").jqxGrid('setcellvalue', rowIndex, '_isDirty', true);				
    				$("#grid").jqxGrid('endupdate');
    				$("#grid").jqxGrid('endcelledit', rowIndex, columnDataField, false);
    				$("#grid").jqxGrid('endcelledit', rowIndex, '_isDirty', false);
    			});

    it is stuck on the edited cell.

    Dirty Flag in JqxGrid #57275

    Peter Stoev
    Keymaster

    Hi yaohancz,

    “endcelledit” hides an opened editor, if there is such. Also beginupdate/endupdate should be removed in this case. This is absolutely not necessary. You can learn how to use it from its JSFiddle sample in the API Docs.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Dirty Flag in JqxGrid #86160

    shylu
    Participant

    Hi Peter,

    I am using jqxgrid – pop- up window example for my project, And i wanted to implement dirty flag on pop-up cancel. Please suggest. I tried beforeunload but it doesnt seem to work as i expect.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.