ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: lucafik on March 30, 2015, 09:26:24 pm

Title: CheckboxColumn
Post by: lucafik on March 30, 2015, 09:26:24 pm
How can I represent the boolean value from the HTML table in a pqgrid.

I have used
type: 'checkBoxSelection', cb: {all: true, header: false}

and created a pqgrid from an html table
var $grid = $("#tbl_for_grid").pqGrid(newObj);

but all of my rows are marked as checked and selected, like this.
http://pokit.org/get/img/f25ebcc2d0b05c277bdb7efa6369e9cd.jpg

I dont want my rows to be selected, and I need the value to correspond the values in the table.
Title: Re: CheckboxColumn
Post by: paramvir on March 30, 2015, 10:21:30 pm
you don't need checkBoxSelection column. How are the boolean values stored in the table. If they are just true & false, you could probably display them as true / false in pqGrid too.
Title: Re: CheckboxColumn
Post by: lucafik on March 31, 2015, 05:32:20 pm
I can display them as textual true/false, but I need a checkbox that will be checked depending on the value in the html table. Sorry, now I see that my question wasnt quite clear.

Is that possible?
Title: Re: CheckboxColumn
Post by: paramvir on March 31, 2015, 11:25:03 pm
If you want to display checkboxes, then implement a render callback for that column.

render: function(ui){
    return "<input type='checkbox' "+ (ui.cellData? "checked='checked'" : "") + "/>";
}
Title: Re: CheckboxColumn
Post by: lucafik on April 01, 2015, 02:49:44 pm
thanks, that was the solution!