Author Topic: Checkbox to always show?  (Read 2962 times)

gammax500

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 16
    • View Profile
Checkbox to always show?
« on: November 18, 2015, 04:10:33 am »
I have a boolean column defined by:

{ title: "Remove Login?",  width: 100, dataType: "bool", align: "center", dataIndx: "locked",
                    editor: { type: "checkbox", subtype: 'double', style: "margin:3px 5px;" },
                    validations: [{ type: 'nonEmpty', msg: "Required"}]
}

Is it possible to have the checkbox always show, rather than make the user click to show it?  (See screenshot)

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Checkbox to always show?
« Reply #1 on: November 18, 2015, 09:11:19 am »
In order to always show the checkbox, please use column.type = 'checkbox' and column.editor: false as shown in this example for version 3.2.0:

Code: [Select]
                 {
                        dataIndx: "locked",                       
                        type: 'checkbox',
                        dataType: 'bool',
                        editor: false
                 },

http://paramquery.com/pro/demos/checkbox
« Last Edit: November 18, 2015, 12:36:42 pm by paramquery »

gammax500

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Checkbox to always show?
« Reply #2 on: November 18, 2015, 07:21:17 pm »
Maybe I did something wrong, but I changed the col definition to:
{
     title: "Remove Login?",
     dataIndx: "locked",
          type: 'checkbox',
          dataType: 'bool',
          editor: false
}

This removed the checkbox totally (on click, the field turns into a text field.  See screenshot

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Checkbox to always show?
« Reply #3 on: November 18, 2015, 09:55:31 pm »
My previous example is for v3.2.0. If you have been using older version, please state your version and refer to older demo:

http://paramquery.com/pro/demos24/checkbox

Code: [Select]
{
  title: "Remove Login?",
  dataIndx: "locked",
  type: 'checkBoxSelection',
  editable: false,
  cb: { all: false, header: false}
},

Also you have to return false in check and uncheck events as shown in the demo.

Please note that tracking history ( undo / redo ), copy/paste & custom rendering is not supported for checkbox columns in older version.
« Last Edit: November 18, 2015, 09:58:05 pm by paramquery »

gammax500

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Checkbox to always show?
« Reply #4 on: November 19, 2015, 02:14:54 am »
My version was v3.1.0 .  After upgrading to the latest version, everything now works.  Thank you!
« Last Edit: November 19, 2015, 03:00:38 am by gammax500 »