Hello sir/mam,
I just face one issue in iggrid . I get confused between methods and options . Could you clarify it please. I know it's a silly question but it might help me in future if i grasp a good understanding of it.
That’s a very good question — and definitely not a silly one! Understanding the difference between methods and options in igGrid is really important for mastering how it works. Options are basically the settings or configurations you define when initializing or updating the grid (like enabling sorting or setting column widths), while methods are actions or functions you call on the grid after it’s been created (like refreshing data or selecting a row). Once you get that distinction clear, working with igGrid becomes much easier and more flexible. Great that you’re taking the time to understand it deeply!
Contact snow rider@.com to learn more!
In igGrid, methods are the actions you take to make the grid do something after it’s already set up, like adding new data or refreshing the display, while options are the settings you choose at the start or adjust later to control how the grid looks and works, such as deciding what columns to show or whether sorting is allowed. You can think of options as the plan you create before launching, and methods as the steps you take afterward to keep it running smoothly—similar to business marketing ideas, where you first plan your strategy and then take specific actions to make it successful.
Hi Rohit, it’s not a silly question at all—understanding the difference between methods and options in igGrid can really help avoid confusion. In simple terms, options are configuration settings you define when initializing the grid, such as enabling sorting, filtering, or setting column widths—they control the grid’s behavior and appearance. Methods, on the other hand, are functions you can call after the grid is initialized to interact with it, like updating data, selecting rows, or destroying the grid. Think of options as how you set up the grid and methods as how you control it dynamically. It’s kind of like a spin wheel yes or no—options define what’s on the wheel, and methods let you spin it and get a "yes or no" outcome depending on the action you perform.
Hello,
Thank you for your question—it's actually a very good one, and definitely not silly at all! Understanding the difference between methods, options, and events in the context of the Ignite UI for jQuery igGrid can really help streamline your development and make troubleshooting easier down the line. Let me explain each of these clearly for you.
Options are settings or configuration values that define how the grid behaves and looks when it is initialized.
$("#grid").igGrid({ width: "100%", columns: [ { headerText: "ID", key: "ID", dataType: "number" }, { headerText: "Name", key: "Name", dataType: "string" } ], features: [ { name: "Sorting" }, { name: "Paging", pageSize: 10 } ] });
In the example above:
Methods are functions that you can call after the grid is initialized. They are used to manipulate the grid dynamically—for example, to update data, refresh the grid, get selected rows, etc.
// Rebind the grid's data $("#grid").igGrid("dataBind"); // Retrieve all rows from the grid var allRows = $("#grid").igGrid("allRows");
Events are triggered by user interaction or programmatic actions on the grid (like row selection, paging, or data binding). You can hook into these events to execute custom logic.
$("#grid").igGrid({ dataBinding: function (evt, ui) { console.log("Data is about to be bound to the grid."); }, rowSelectionChanged: function (evt, ui) { alert("A row has been selected."); } });
For an in-depth exploration of all available options, methods, and events, please consult the Ignite UI for jQuery API Reference. This resource provides comprehensive documentation to assist you in leveraging the full capabilities of the igGrid.
If you have any further questions or need assistance with specific features, feel free to ask!
Regards,
Georgi Anastasov
Associate Software Developer
Infragistics