Author Topic: Problem with checkbox  (Read 2211 times)

emontes

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 8
    • View Profile
Problem with checkbox
« on: April 27, 2016, 06:23:36 pm »
I have the following definition

{ title: "Visible", dataType: "integer", dataIndx: "visible", width: 20, align: "center",
          filter: { type: 'textbox', condition: 'equal', listeners: ['change']},
          type: 'checkbox',
          cb: {
              check: "1",
              uncheck: "0"
          }, 
         },   

When an item is unchecked and I try to check it everything works fine.  But when the Item is Uncheked and I chek it, the state is stored in the database, but the item does not appears checked in the pqgrid.  Am I doing something wrong?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Problem with checkbox
« Reply #1 on: April 27, 2016, 08:51:07 pm »
My first guess it's because dataType is 'integer' in your column but you are trying to assign "1" and "0" which are strings.

Please try to use 1 and 0 with dataType: 'integer' or "1" and "0" with  dataType: 'string'

Kindly share a jsfiddle if still facing issues.
« Last Edit: April 27, 2016, 08:52:47 pm by paramquery »