Author Topic: Using callback for column filter  (Read 2993 times)

RedBully

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
Using callback for column filter
« on: November 03, 2014, 05:58:07 pm »
I'm trying to use the callback for filter type as per
http://paramquery.com/pro/api#option-column-filter

Quote
type can be textbox, textarea, select, checkbox, callback function, html string or null. subtype can be triple for tri - state checkbox.

In my column model, I use
Code: [Select]
filter:
{
type: function (ui) { oa.renderFilter(this, ui); }
},

where my called method is

Code: [Select]
oa.renderFilter = function (grid, ui) {
        return "<div>Test</div>";
}

The table cell where the filter should be rendered is empty:

Code: [Select]
<td class="pq-grid-col"><div class="pq-grid-header-table-div" style="padding:0px 2px;"></div></td>

Am I correct to be returning html which should then be rendered or am I using the callback incorrectly?

I couldn't find a suitable example to copy in
http://paramquery.com/pro/demos/filter_header_local

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Using callback for column filter
« Reply #1 on: November 03, 2014, 07:40:11 pm »
You are correct in returning HTML string, but first return is missing from your code.

Code: [Select]
type: function (ui) { return oa.renderFilter(this, ui); }

RedBully

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
Re: Using callback for column filter
« Reply #2 on: November 03, 2014, 08:41:15 pm »
Of course!  Thanks very much!