EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: thecyberzone on June 29, 2019, 08:17:32 AM



Title: Disabling some rows in combogrid
Post by: thecyberzone on June 29, 2019, 08:17:32 AM
A combogrid is populated through a PHP url and having following column declarations:

      columns: [[
         {field:'PROGCODE',title:'ProgCode',width:60,align:'center'},
         {field:'PROGNAME',title:'Program Name',width:400,align:'left'},
         {field:'ST_DT',title:'St. Date',width:80,align:'center'},
         {field:'DURATION',title:'Days',width:60,align:'center'},
         {field:'TARGET',width:0,hidden:true},
         {field:'CNT',width:0,hidden:true}
      ]]

Now I want to disable selection of those rows who's CNT>=TARGET. How this can be achieved ? I have tried as follows in PHP file during making returned array, but failed:

      if ($row->CNT >= $row->TARGET){
         // $row->selected=false;
         // $row->disabled=true;   
      }

Another method may be in onLoadSuccess function, but I failed to code, any example is solicited.


Title: Re: Disabling some rows in combogrid
Post by: jarry on June 30, 2019, 06:54:18 PM
Return false in the 'onBeforeSelect' event to prevent from selecting that row.
Code:
onBeforeSelect: function(index,row){
if(...){
return false;
}
},


Title: Re: Disabling some rows in combogrid
Post by: thecyberzone on June 30, 2019, 11:30:40 PM
Thanks, it works, some more activity has solved using this.