jQWidgets Forums

jQuery UI Widgets Forums Grid This is a question about row update in grid. Reply To: This is a question about row update in grid.


kimmansu
Participant

Thank you for your answer.

I solved it as below.

     var selectedrowindex = $("#jqxgrid").jqxGrid('getselectedrowindex');
     var rowscount = $("#jqxgrid").jqxGrid('getdatainformation').rowscount;
     if (selectedrowindex >= 0 && selectedrowindex < rowscount) {
         //정렬상태에서는 updaterow가 동작하지 않음으로 상태를 저장, 정렬 초기화, 상태를 다시 불러오는 방식으로 처리하자.
                            $("#jqxgrid").jqxGrid('savestate'); //상태 저장
                            $("#jqxgrid").jqxGrid('clearfilters'); // 검색 초기화
                            $("#jqxgrid").jqxGrid('removesort'); // 정렬 초기화
     
         var id = $("#jqxgrid").jqxGrid('getrowid', selectedrowindex);
         var commit = $("#jqxgrid").jqxGrid('updaterow', id, datarow);
         //$("#jqxgrid").jqxGrid('ensurerowvisible', selectedrowindex);
         
                            $("#jqxgrid").jqxGrid('loadstate'); // 저장된 상태 로드
     }