EasyUI Forum
May 19, 2024, 05:18:28 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: edatagrid getChecked() does not work after saveRow in easyui1.5  (Read 8012 times)
citos
Newbie
*
Posts: 5


View Profile
« on: August 13, 2016, 04:37:50 AM »

Hello,
First let me list how I use edatagrid :
1)initialize
<table id="cn_datagrid_table" title="When Repeats">
   <thead>
      <tr>
         <th data-options="field:'ck',checkbox:true"></th>
         <th data-options="field:'day'" width="30%">Day of Week</th>      
            <th data-options="field:'repeat_start_time',editor:{type:'timespinner',options:{required:true}}" width="30%">Start Time</th>
            <th data-options="field:'duration',editor:{type:'numberbox',options:{precision:0,required:true,min:15,max:150}}" width="30%">Duration</th>
      </tr>
   </thead>
</table>
   var data_grid_ops=$.extend(true,{},   DEFAULT_DATAGRID_OPTIONS,{
      pagination:false,
      toolbar: "#tb",
      fit:false,
      data:[{"day_of_week":"1","day":"Monday"},{"day_of_week":"2","day":"Tuesday"},{"day_of_week":"3","day"
:"Wednesday"},{"day_of_week":"4","day":"Thursday"},{"day_of_week":"5","day":"Friday"},{"day_of_week"
:"6","day":"Staturday"},{"day_of_week":"7","day":"Sunday"}]   
   });
   $("#cn_datagrid_table").edatagrid(data_grid_ops);      

2)Check on some rows, double click a table row to edit data and click "save row" which call $('#cn_datagrid_table').edatagrid('saveRow')
3)Click "showDebugInfo" , it shows checked row data info.
function showDebugInfo(){
    var row=$("#cn_datagrid_table").datagrid("getChecked");
    if(row!=null && row.length>0){
        $.messager.alert("Message","Checked rows:<br>"+JSON.stringify(row),"info").window({width:800,resizable:true}).window("center");         
    }else{
        $.messager.alert("Message","no row checked.","info");
    }
}

The edatagrid (http://www.jeasyui.com/extension/edatagrid.php) works fine in easyui1.4.5 until I upgrade to version 1.5.
After I checked a row, edit it and save row, I click "showDebugInfo", it showed "no row checked."
Then I manually uncheck and check this row, click "showDebugInfo" again, it showed the checked row info now.
Keep the row checked, I edit the row again, click save row, the  "showDebugInfo" shows "no row checked."

So the issue is that the datagrid getChecked function lose efficacy after "endEdit".
Now I have to downgrade to easyui 1.4.5.  Hope the easyui team can fix this issue soon.

Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #1 on: August 14, 2016, 02:11:17 AM »

Please download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.5-patch.zip.
Logged
citos
Newbie
*
Posts: 5


View Profile
« Reply #2 on: August 16, 2016, 02:30:40 AM »

it works now. thanks a lot for your quick response.
To avoid additional code changes, now I added the patch into jquery.easyui.min.js.
I think the easyui will include the patch in its later release. let's look forward for it.
« Last Edit: August 16, 2016, 08:32:21 AM by citos » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!