Author Topic: Execute function onSelect  (Read 2598 times)

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Execute function onSelect
« on: October 12, 2016, 08:32:29 pm »
Trying to call function when a certain select option is chosen in toolbar.

Code: [Select]
...
type: 'select',
label: 'Select ',               
options: [{ default: '', test: 'Select1'}],
value: 'default'
...

How can I call function when Select1 is chosen?
Thanks.

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: Execute function onSelect
« Reply #1 on: October 13, 2016, 01:40:27 am »
I got the function to execute with

Code: [Select]
listener: function(){
if ($("#atest").val() == 'test')
{
colModel[0].hidden = false
$("#grid_array").pqGrid('option', 'colModel', $("#grid_array").pqGrid('option', 'colModel'));
}}

However the value for hidden is not applied...?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6265
    • View Profile
Re: Execute function onSelect
« Reply #2 on: October 13, 2016, 04:50:27 pm »
grid also needs to be refreshed.

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: Execute function onSelect
« Reply #3 on: October 13, 2016, 06:21:25 pm »
Great, thanks.

Another question when setting filter, it works fine for type textbox with:

Code: [Select]
$("#grid_array").pqGrid( "filter", {
    oper: 'replace',
    data: [
        { dataIndx: 'column1', value: 'test' }
   
    ]}

But I have issues with type select and textbox with between condition...

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: Execute function onSelect
« Reply #4 on: October 13, 2016, 07:28:21 pm »
Solved.