There are two methods to get and set widget options.
The first method uses jQuery selectors directly. For example, the code below shows how to get or set the allowPaging options on a wijgrid widget using a jQuery selector.
Sample Script |
Copy Code |
---|---|
// getter var value = $(".selector").wijgrid("option", "allowPaging"); // setter $(".selector").wijgrid("option", "allowPaging", true); |
The second method uses jQuery selectors to retrieve the widget instance, and the option method on the widget to get or set the option. For example, the code below shows how to get or set the allowPaging option on a wijgrid widget using the widget instance.
Sample Script |
Copy Code |
---|---|
var widgetInstance = $(".selector").data("wijmo-wijgrid"); // getter var value = widgetInstance.option("allowPaging"); // setter widgetInstance.option("allowPaging", true); |