Author Topic: Row 0 Filter For Check Boxes Issue  (Read 2176 times)

cijojohn

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 73
    • View Profile
Row 0 Filter For Check Boxes Issue
« on: April 08, 2017, 05:26:23 am »
Hi Team,

We are facing issue for filter in Header Row with check box type as it is not filtering the unchecked check boxes.

Since check boxes  our customized according to the screens. Do we need to do any specific thing in order to make it work in row 0 filter.

Customized Rendering of check boxes  :

function renderColumnValue(ui {
var cb = ui.column.cb,
         cellData = ui.cellData,
         checked = cb.check === cellData ? 'checked' : '';
       if(typeof(checkDisable) == "undefined" ){
            var disabled = false;
         }
       else{
            var disabled = checkDisable(ui); //this will apply disable class to check box
         }
        return {
            text: "<label><input type='checkbox' " + checked + " /></label>",
            cls : (disabled ? disableClass : "")
        };
}

Callback for check box :
function callBack(type) {
   if (type.toUpperCase() == "BOOL") {
      return {         
                all: false,
                header: true,
                check: true,
                uncheck: false         
      };
   }
}
« Last Edit: April 08, 2017, 05:28:15 am by cijojohn »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Row 0 Filter For Check Boxes Issue
« Reply #1 on: April 09, 2017, 09:52:01 pm »
Please refer this example ( Paid column ) for checkbox filtering: https://paramquery.com/pro/demos/filter_header_local

It's not clear what callBack is doing in your code.

Have you defined column.filter property and column.dataType as 'bool' ?

And what is the complete column definition?

cijojohn

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 73
    • View Profile
Re: Row 0 Filter For Check Boxes Issue
« Reply #2 on: April 13, 2017, 09:45:27 pm »
Hi Team,

i refer the code and figured out that for few unchecked columns, if data is coming as null or blank..it is not filtering them out. So is it necessary to set them false in case of null in grid data. Or it can be handled on sort event.

If the check box value is null..its not filtering out. But if i check/uncheck the columms it is working for only changed columns since they have now false as thier value.