Author Topic: How to disable a toolbar button ?  (Read 3370 times)

tcf

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 13
    • View Profile
How to disable a toolbar button ?
« on: January 31, 2016, 03:17:51 am »
I've tried the following to disable a toolbar button but it does not wok?

$( "#grid_control" ).pqGrid("option", "toolbar").items[0].options.disabled = true;

This error is returned:
Unable to set property 'disabled' of undefined or null reference

Thanks
« Last Edit: January 31, 2016, 06:02:05 am by tcf »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6296
    • View Profile
Re: How to disable a toolbar button ?
« Reply #1 on: February 01, 2016, 12:02:09 pm »
Setting toolbar options directly is not supported currently, buttons can be disabled with jQueryUI API.

$( ".selector" ).button("option", { disabled: true/ false });

In this example toolbar buttons are enabled and disabled from history event.

http://paramquery.com/pro/demos/editing_batch