Flexigrid's on row click - How to implement rowClick action of flexigrid using codeigniter's library
Tech-Today

Flexigrid's on row click - How to implement rowClick action of flexigrid using codeigniter's library


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);
}
)
}




- How To Display An Alert View With Swift
Display an Alert View with Swift First we'll create a constant of UIAlertController. Since we'll be using an alert, the UIAlertControllerStyle is set to default. It can have other values such as ActionSheet, Alert, and RawValue.  let alertPrompt...

- Adding Loading Screen To C# Mvc Ajax Dialog Form Using Jquery
With my experience from telerik, I want my entity's add and edit form to be a popup so I don't have to change screen. I'm using C# MVC3, so I tried to look for jquery add on that would do the job. Fortunately I've come up with this article:...

- Jquery Datepicker Show Only The Month And Year
I have created a report search form that filter the monthly record of sales. So I don't really care about the specific day but the month. Jquery has a nice DatePicker library, but it can't be customized to remove the month part, so just hide it...

- Allowing Url Query String In Codeigniter
As we all know codeigniter uses segment-based as url, example: Just like these: classname/methodname/parameter1/paramenter2, index.php/index/login/user/password Unfortunately, I was developing a web application that would accept payments via paypal. And...

- How To Create A New Index Inside A Subdirectory In Codeigniter
I am using codeigniter framework in my php project and I have a requirement like this: When the url is */admin/, the application should call the index.php inside the admin folder. Folder structure: +codeigniter app +application +controller +index.php...



Tech-Today








.