EasyUI Forum
May 01, 2024, 11:55:30 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Disabling some rows in combogrid  (Read 3511 times)
thecyberzone
Full Member
***
Posts: 176



View Profile Email
« 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.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 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;
}
},
Logged
thecyberzone
Full Member
***
Posts: 176



View Profile Email
« Reply #2 on: June 30, 2019, 11:30:40 PM »

Thanks, it works, some more activity has solved using this.
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!