1

I wanted to implement JqGrid in my Project.

But, here my requirement is that i need to display controls in the grid.

For example, i have a column that can take values either true or false.

But, i would like to represent this in the form of checkbox checked and unchecked format.

So, i wanted to know whether this is possible or not by using JqGrid. Please help.

Vinoth Krishnan
  • 2,925
  • 6
  • 29
  • 34
Sai Avinash
  • 4,683
  • 17
  • 58
  • 96

2 Answers2

3

jqGrid supports many predefined formatters which include formatter: "checkbox". It displays disabled (the user can't check/uncheck the checkboxs) checkboxs. You can use true, false or 1, 0 as the input values for the formatter: "checkbox".

One can use custom formatters additionally in the cases when you don't find predefined formatters which full correspond your requirements, but in case of usage checkboxs the standard formatter: "checkbox" should be OK.

Oleg
  • 220,925
  • 34
  • 403
  • 798
2

Yes you can do it with formatter in a column model

{
name: 'MyCol', index: 'MyCol', editable:true, edittype:'checkbox', 
editoptions: { value:"True:False"},formatter: "checkbox"
}

or you can specify a custom fortmatter to render the column

formatter: checkboxColumnRenderer

then

function checkboxColumnRenderer(cellValue, opts, rowObject){
   return "checkbox-html";
}

Check jqGrid with an editable checkbox column and Create Checkbox in jqGrid and

Community
  • 1
  • 1
Murali Murugesan
  • 22,423
  • 17
  • 73
  • 120