Nov 05, 2013, 3:52 PM
[CLOSED] Projection of getRowsValues?
I have two grids - MyCategoryGrid and MyItemsGrid which display data from two database tables, MyCategory and MyItems. MyCategoryID is the PK in MyCategory and the FK In MyItems.
I have a function, ShowItems, that gets the selected items from MyCategoryGrid and shows all the associated MyItems in MyItemsGrid. I pass the selection using store.getRowsValues to get an Ext.data.Model, and pass that to a DirectMethod which takes it in as a Dictionary<string, string>[] MySelectedCategories. I then create a List<int> MySelectedCategoryIDList in C#:
I'd love to push the process of projecting the MyCategoryID column from MyCategoryGrid to a library function; say a
Thanks!
I have a function, ShowItems, that gets the selected items from MyCategoryGrid and shows all the associated MyItems in MyItemsGrid. I pass the selection using store.getRowsValues to get an Ext.data.Model, and pass that to a DirectMethod which takes it in as a Dictionary<string, string>[] MySelectedCategories. I then create a List<int> MySelectedCategoryIDList in C#:
ItemsJS = {
ShowItems: function() {
var MySelectedCategories = MyCategoryGrid.getRowsValues({selectedOnly: true});
App.direct.GetItemsForCategory(MySelectedCategories);
}
};
[DirectMethod]
void GetItemsForCategory(Dictionary<string,string>[] MySelectedCategories)
{
List<int> mySelectedCategoryIDList = MySelectedCategoryIDList(MySelectedCategories);
BindItemsGridForSelectedCategories(mySelectedCategoryIDList);
}
List<int> MySelectedCategoryIDList(Dictionary<string,string>[] MySelectedCategories)
{
List<int> MySelectedCategoryIDList = new List<int>();
foreach (Dictionary<string,string> MyCategory in MySelectedCategories)
{
MySelectedCategoryIDList.Add(Int32.Parse(MyCategory["MyCategoryID"]));
}
return MySelectedCategoryIDList;
}
and pass that back to a stored procedure which returns the values for the MyItemsGrid. I'd love to push the process of projecting the MyCategoryID column from MyCategoryGrid to a library function; say a
ItemsJS = {
ShowItems: function() {
var mySelectedCategoryIDList = MyCategoryGrid.getRowsValues({selectedOnly: true}).getColumnValues("MyCategoryID");
BindItemsGridForSelectedCategories(mySelectedCategoryIDList)
}
};
Is there such a function? (I can't find an appropriate method on the Sencha site or in the ext-all.js file).Thanks!
Last edited by Baidaly; Nov 06, 2013 at 12:05 AM.
Reason: [CLOSED]