ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: gammax500 on November 18, 2015, 04:10:33 am

Title: Checkbox to always show?
Post by: gammax500 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)
Title: Re: Checkbox to always show?
Post by: paramvir 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
Title: Re: Checkbox to always show?
Post by: gammax500 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
Title: Re: Checkbox to always show?
Post by: paramvir 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.
Title: Re: Checkbox to always show?
Post by: gammax500 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!