In a listGrid, I am using myListGrid.setFields(newFields) in the data arrived: callback to manipulate column headings. The underlying data is manipulated (add/deleted) using another Tab which invalidates the columns that are currently being displayed.
As per the API docs: " ListGrid.setFields(newFields) - Sets the fields array and/or field widths to newFields and sizes, respectively. If newFields is specified, it is assumed that the new fields may have nothing in common with the old fields, and the component is substantially rebuilt. Furthermore, it's invalid to modify any of the existing ListGridFields after they've been passed to this function."
Since it is invalid to modify existing fields, it seems that I would need to re-instantiate the listGrid so that the columns will be recalculated based on the current data.
How would I go about doing this?
I have tried assigning the listGrid to a var, and nulling out the var to destroy the existing listGrid, and then re-assigning, but this does not work.
I am currently reloading the html page as a workaround. There must be a better way to handle this. What is the magic incantation?
As per the API docs: " ListGrid.setFields(newFields) - Sets the fields array and/or field widths to newFields and sizes, respectively. If newFields is specified, it is assumed that the new fields may have nothing in common with the old fields, and the component is substantially rebuilt. Furthermore, it's invalid to modify any of the existing ListGridFields after they've been passed to this function."
Since it is invalid to modify existing fields, it seems that I would need to re-instantiate the listGrid so that the columns will be recalculated based on the current data.
How would I go about doing this?
I have tried assigning the listGrid to a var, and nulling out the var to destroy the existing listGrid, and then re-assigning, but this does not work.
Code:
var prodLG = isc.ListGrid; prodLG.create(listGridParms);
Code:
prodLG = null; prodLG = isc.ListGrid; prodLG.create(listGridParms);
Code:
Component Hierarchy <DataView> <TabSet> <VLayout> <myListGrid>
Comment