no

How to Implement Rowclick on Flexigrid Using Codeigniter'

The objective of this writing is to update the flexigrid library so that it can handle the rowClick event. To do this we need to download t...

The objective of this writing is to update the flexigrid library so that it can handle the rowClick event. To do this we need to download the latest version of flexigrid's library here: http://flexigrid.eyeviewdesign.com/, extract and setup accordingly inside the codeigniter's library. How to do: 1.) Modify the flexigrid_helper.php inside the codeigniter's application/helper folder. At line 82 you should see this line:
$grid_js .= "{display: '".$value[0]."', ".($value[2] ? "name : '".$index."', sortable: true," : "")." width : ".$value[1].", align: '".$value[3]."'".(isset($value[5]) && $value[5] ? ", hide : true" : "")."},";
//Replace with:
$grid_js .= "{display: '".$value[0]."', ".($value[2] ? "name : '".$index."', sortable: true," : "")." width : ".$value[1].", align: '".$value[3]."'".(isset($value[5]) && $value[5] ? ", hide : true" : "").(isset($value[6]) ? ", process : $value[6]" : '').""."},";
//Notice that we add a handler for the 6 colModel attribute.
2.) Therefore we have to add that 6th parameter to the colModel array like this: $colModel['id'] = array('ID', 100, TRUE, 'center', 1, 0, 'rowClick'); Note: if you want each row to do the same action just add the last two parameters to each colModel items. 3.) Finally, in our view we need to implement the javascript function rowClick:
function rowClick(celDiv, id){
 $(celDiv).click(
  function() { 
   alert(id);
  }
    )
}

Related

web 1866028747197420203

Post a Comment Default Comments

Outsourcing

Are you looking for freelancers in the Philippines? Get in touch.

Donations

If you like what I do, you can support this channel by buying me a coffee. I would be grateful for your contribution! Your donations will help me create more FREE online courses and learning materials for programmers and remote workers.

item