-
Render list to grid cell
Hi!
Can you suggest me, how render data from list of objects into cell and every list item should be as separate element (label, for exapmle)?
DataIndex of column is "TestList".
TestList is a list of "TestObject"
TestObject has properties: id, type and name.
-
Hello @BogDan!
Here's an example of a Grid Panel filled with a List of objects in our examples explorer:
- Grid Panel > Miscellaneous > Generic List
Hope this helps!
-
@fabricio, thank you for your reply, but i need to render list to 1 cell of grid, not to whole grid.
as a solution i tried to use componentColumn and Multiselect as it`s component:
Code:
X.ComponentColumn()
.Selectable(false)
.DataIndex("List") //it is list of values, whitch i want to use as multiselect items
.Component(
X.MultiSelect()
.DragGroup("grp2")
.DropGroup("grp2")
.MultiSelect(true)
.Items(
X.ListItem().Text("Item 1").Value("1"),
X.ListItem().Text("Item 2").Value("2"),
X.ListItem().Text("Item 3").Value("3"),
X.ListItem().Text("Item 4").Value("4"),
X.ListItem().Text("Item 5").Value("5")
)
)
but i don`t understand, how to use elements from dataindex of my component column as items of multiselect component.
Becides, i want customise standart list of multiselect, how can i use Tpl or something similar?
I couldn`t find such exapmles on ext.net site.
-
Hello again, @Bogdan!
I am afraid I will reply you with another example, and I am pretty confident it will get you just a notch away from attaining your objective.
- Editor Field Mapping
The change it would have from what you need, I suppose, is just instead of returning a single item in the renderer, it would return an array of items for the multi-combo.
Hope this helps!
-
1 Attachment(s)
Hi, @fabricio.
I`ll describe my problem in more detail: i need to present list of objects in cell of gridpanel as blocks.
Attachment 25196
Next i need to release opportunity to select one ore more of this blocks in one row and drag&drop them to other row.
I have two options for release it. First, i tried to do this with dataView component and my own html-template for blocks in cell. it looked like i needed, but i don`t know, how implement multiselection and drag&drop of this blocks.
Second, i tried to do this with component column and multiselect component. In such implementation multiselect and drag&drop work well, but i don`t know, how to use own template for list of items inside multiselect component and how to attach data from ComponentColumn - DataIndex to multiselect items.