Author Topic: Event change of button in toolbar is different  (Read 1481 times)

atmaneuler

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 33
    • View Profile
Event change of button in toolbar is different
« on: October 22, 2020, 10:01:18 am »
I try to make show/hide column by toolbar buttons like demo:
https://paramquery.com/demos/showhide_columns

But it occure error at:
Code: [Select]
var arr = $(this).val(),
Quote
ERROR TypeError: Cannot read property 'toLowerCase' of undefined
    at jQuery.fn.init.val (jquery.js:8441)

I try to log, and this I got:
With demo:

And what I get on my


What did I misssing?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Event change of button in toolbar is different
« Reply #1 on: October 22, 2020, 10:15:47 am »
You have taken the code from the free version example.

There is difference between "this" context in the toolbar event listeners between the free version and Pro version.

In Pro version, "this" context variable is the grid instance, hence the error.

Please take help of the Pro example to set up show hide columns:

https://paramquery.com/pro/demos/showhide_columns
« Last Edit: October 22, 2020, 10:22:40 am by paramvir »