I am trying to have a editable grid, minimizing network traffic. The grid is only editied 1/20 page loads.
My data model is like this:
Items: ItemdID, ItemName
ItemSerials: ItemSerialID, ItemSerial, ItemID
Units: UnitID, ItemID, Unit
ItemRental: ItemRentalID, ItemID, ItemSerialID, UnitID, Quantity
There may be multiples serials, and Units for each Item.
The data comes from the backend as a Join: with the fields from all 4 tables.
I would like the grid to Show:
ItemName, SerialNumber, Units, Quantity
But need to save an ItemRental row.
Initially I had the table with an ItemID column, using a template which called a lookup function (getName(itemid)) which displayed the ItemName. In order for this to work, I had to pull the entire Items table into memory, so that the lookup function could use it.
The ItemSerials table is worse, as it has 100,000 serrals, but only a handful are applicable to each item. So in order to show SerialNumber, but have ItemSerialID as my value, I have to pull the whole table into memory too. Yes, for loading the drop-down-list I can use the selected item, and filter the fetched serials based on that, but in order to show SerialNumber, but have ItemSerialID as my value field using template which alls function like the item name (getSerial(serialid), I need to have all in memory.
I would like to handle this by having all fields as part of my data model, then only showing four mentioned, and hiding the Id columns. My drop downlist for ItemName woulld be on the item name field would then transport.read in all the items on creation of the first editor (dd list). The DDL would read in the whole Items table, be the editor for the ItemName column, but I would also need it to set the value in the ItemID column:
I can get the itemID in my 'change' function for the DDL, like this: e.sender.options.dataSource[e.sender.selectedIndex].ItemID, but then what do I do with it? How do I set the value of the hidden ItemID column?
Then another tricky part is when the Item is selected, I then need to cascade the DDL for the SerialNumber column based on ItemID, not on ItemName....
Is there a better way to solve this problem, and avoid pulling unecessary data into memory? I need to show employer bandwidth test in order to buy.
Thanks,
~S
My data model is like this:
Items: ItemdID, ItemName
ItemSerials: ItemSerialID, ItemSerial, ItemID
Units: UnitID, ItemID, Unit
ItemRental: ItemRentalID, ItemID, ItemSerialID, UnitID, Quantity
There may be multiples serials, and Units for each Item.
The data comes from the backend as a Join: with the fields from all 4 tables.
I would like the grid to Show:
ItemName, SerialNumber, Units, Quantity
But need to save an ItemRental row.
Initially I had the table with an ItemID column, using a template which called a lookup function (getName(itemid)) which displayed the ItemName. In order for this to work, I had to pull the entire Items table into memory, so that the lookup function could use it.
The ItemSerials table is worse, as it has 100,000 serrals, but only a handful are applicable to each item. So in order to show SerialNumber, but have ItemSerialID as my value, I have to pull the whole table into memory too. Yes, for loading the drop-down-list I can use the selected item, and filter the fetched serials based on that, but in order to show SerialNumber, but have ItemSerialID as my value field using template which alls function like the item name (getSerial(serialid), I need to have all in memory.
I would like to handle this by having all fields as part of my data model, then only showing four mentioned, and hiding the Id columns. My drop downlist for ItemName woulld be on the item name field would then transport.read in all the items on creation of the first editor (dd list). The DDL would read in the whole Items table, be the editor for the ItemName column, but I would also need it to set the value in the ItemID column:
I can get the itemID in my 'change' function for the DDL, like this: e.sender.options.dataSource[e.sender.selectedIndex].ItemID, but then what do I do with it? How do I set the value of the hidden ItemID column?
Then another tricky part is when the Item is selected, I then need to cascade the DDL for the SerialNumber column based on ItemID, not on ItemName....
Is there a better way to solve this problem, and avoid pulling unecessary data into memory? I need to show employer bandwidth test in order to buy.
Thanks,
~S