I am trying to resize the columns of my iggrid dynamically, after initialize the grid with autogenerate feature.
right now the feature is initialize with the grid, i am able to drag and resize columns, and the corresponding events are fired, but when i do this command for setting the with on an specific column, $('#candidate-list-static').igGrid("resize", 0, 50);, i get this error (Error: cannot call methods on igGridResizing prior to initialization; attempted to call method 'resize').
i do not know what to do next, someone could help with this please?.
Thanks
Hello Juan,
The "resize" is a method of the igGridResizing widget, so you need to execute is as follows:
$('#candidate-list-static').igGridResizing("resize", 0, 50);
Please try it and let me know the result.
i am still having an error, different one but the grid is still not functioning.
(Error: cannot call methods on igGridResizing prior to initialization; attempted to call method 'resize')
I was having a similar issue, changed from a <div> to a <table> and it now works.
Hello,
I am just checking up to see if you had the time to review my sample and modify it.
I used the code shared to configure a grid and I was not able to experience this behavior. Please run the sample on your side and let me know the result. Feel free to modify it in a way so that it reproduces the behavior.
I have initialize the grid in a table element.
I have tried to call the rezise method after finishing the render, in the rendered: function (evt, ui){} event. If i call another method, no error shows up.
$("#candidate-list-static").igGrid({ dataSource: data, width: "100%", autoGenerateColumns: true, renderCheckboxes: true, primaryKey: 'ItemId', features: [ { name: "Filtering" }, { name: "Paging", pageSize: 5, pageSizeList: [5, 10, 15, 20, 50, 100] }, { name: "Sorting" }, { name: 'Hiding', columnSettings: [ { columnKey: 'ItemId', allowHiding: false, hidden: true }, { columnKey: 'PkItemId', allowHiding: false, hidden: true }, { columnKey: 'ParentPkItemId', allowHiding: false, hidden: true } ] }, { name: "ColumnMoving", mode: "deferred", movingDialogDisplayText: "Move Column"
}, { name: 'Resizing', deferredResizing: true, columnResizing: function(event, args) { var headerLength = $('#candidate-list-static').igGrid('headersTable').find('th[id$="' + "Indication" + '"] span.ui-iggrid-headertext').html().length; if (args.desiredWidth < headerLength) { return false; } }, allowDoubleClickToResize: true }, { name: "RowSelectors", enableCheckBoxes: true, enableRowNumbering: false }, { name: "Selection", multipleSelection: false } ] //rendered: function (evt, ui) { // alert("Rendered"); //} });
I execute the method in place of the alert on the rendered event.
When initializing the grid in a <div> element similar errors are received. If this is the case please initialize the grid in a <table> element.
Otherwise I would need more details to investigate this. Could you clarify at what time/event you are trying to call the resize method ? Do you happen to see this error if you call another method also ? It will be highly appreciated if you could provide a sample that demonstrates this issue or share your code.
Looking forward to hearing from you.