PDA

View Full Version : [CLOSED] Multiple Elements to Cell Data in Model



macinator
Oct 22, 2013, 3:34 PM
Hi,

I wonder if someone can give me suggestions on how to go about doing something

I am developing a dynamic grid component - that has a variable number of columns and a variable number of cells
Each cell in the grid has 3 pieces of information
1. the data for the cell
2. the styling for the cell
3. the orginal server value


What is the best way to setup the datastore and grid for this kind of grid
How would i implement the renderer so that the columns displays only the data for the cell, but applies the style for the cell and when i invoke a direct event i am able to pass the original server value for the cell concerned

Thanks

Mac

geoffrey.mcgill
Oct 22, 2013, 4:03 PM
Hi,

Just a quick idea, but I would store each of those three values as separate values in the Store record. Then use the GridPanel Renderer to style the "data in the cell" based on the "styling for the cell".

The original value would remain unchanged in the Store.

Hope this helps.

macinator
Oct 22, 2013, 4:17 PM
Hi,

I am very new to ext.net so please forgive my ignorance

But if I do that - I would end up with a huge number of fields in my data store

if i had 3 columns - I would end up with 9 values per record (3 * 3)
if i had 5 columns - I would end up with 15 values per record (5 * 3)

Is there a way within EXT.net the value for a cell can be a json data object with three properties (data, styling, servervalue) ?
do you have an example of this

I am looking at implementing the meta style grid store, but I am just trying to figure out the most efficient way to store properties on a cell and be able to reference those properties in javascript

Thanks

Mac

Baidaly
Oct 23, 2013, 12:52 AM
Hello!

I'm agree with Geoffrey, you should store each Entity in its own field. You shouldn't think that if you double or triple amount of Store fields, the whole performance goes down accordingly. It wouldn't be sensitive to you or your clients. So I don't see any reason to mix up in one field three different values.


Is there a way within EXT.net the value for a cell can be a json data object with three properties (data, styling, servervalue) ?
do you have an example of this

You can store your JSON object in Store's field as an object or string, which can be decoded on the client side, but again it seems that the conversions and manipulations can cause more sensible performance decrease than storing values separately.

Did you test your component in this two cases? Is there a big difference in performance?