On Row Click disable/enable a button depending on content of a cell in that row

80 views
Skip to first unread message

Bobby

unread,
Oct 22, 2010, 7:12:28 PM10/22/10
to Flexigrid for jQuery
I was wondering if it were possible to disable/enable a button
whenever a row is clicked on depending on the value of a cell
corresponding to the contents of a single column. Thank you for your
help.

Marc Borgers

unread,
Oct 23, 2010, 2:55:38 AM10/23/10
to flexigrid
In the colModel parameter of flexigrid, you can pass a callback
function with name process.
In that function you can hook on a function that is called when a row
is clicked.
I know it sounds difficult. An example will make more clear. Here it is:


function procMe(celDiv,id) {
$(celDiv).click(
function () {alert(this.innerHTML + " " + id); }
);
};


function postFlexigrid()
{
$("#flex1").flexigrid
(
{
url: 'yourURL',
dataType: 'json',
colModel : [
{display: 'Name', name : 'xxx', width : 200, sortable : false,
align: 'left', process: procMe}
],
usepager: false,
singleSelect: true,
title: 'x',
useRp: false,
showTableToggleBtn: true,
height: 150
}
);
}

$(document).ready(function() {
postFlexigrid();
});


procMe will be called and if you click on a row, an alert is shown.

Hope this helps.

Regards, Marc

> --
> You received this message because you are subscribed to the Google Groups "Flexigrid for jQuery" group.
> To post to this group, send email to flex...@googlegroups.com.
> To unsubscribe from this group, send email to flexigrid+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/flexigrid?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages