Author Topic: colSelector and pqSelect  (Read 3145 times)

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
colSelector and pqSelect
« on: November 26, 2016, 02:05:25 am »
Code: [Select]
$(".columnSelector").val("value");
works before it has been converted to pqSelect, after conversion it doesn't work...tried:

$( ".columnSelector" ).pqSelect( "val", "value" );

without success...

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: colSelector and pqSelect
« Reply #1 on: December 04, 2016, 06:15:40 pm »
Any suggestion on this matter?
Thanks.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6307
    • View Profile
Re: colSelector and pqSelect
« Reply #2 on: December 05, 2016, 03:49:53 pm »
After conversion it's again

Code: [Select]
$(".columnSelector").val("value");

followed by refreshData() http://paramquery.com/api/select#method-refreshData

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: colSelector and pqSelect
« Reply #3 on: December 06, 2016, 04:06:43 pm »
Thanks, works but not when I use it a function which is executed by user select.

"Uncaught Error: cannot call methods on pqSelect prior to initialization; attempted to call method 'refreshData'"

Using:

$( ".columnSelector" ).val('Test');
$( ".columnSelector" ).pqSelect( "refreshData" );

The value however seems correctly set and updated...?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6307
    • View Profile
Re: colSelector and pqSelect
« Reply #4 on: December 06, 2016, 04:35:30 pm »
Please use

$( "select.columnSelector" ).val('Test');
$( "select.columnSelector" ).pqSelect( "refreshData" );

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: colSelector and pqSelect
« Reply #5 on: December 06, 2016, 06:31:54 pm »
Perfect, thanks.