| Page 1 of 1 | [ 2 posts ] |
|
I am using YUI 2 together with MVC 3 with Razor. I am using the data table. I am coding on IE 8 and FireFox 6.
Here is my data source JavaScript code: Code: var dtCategoriesDataSource; var yui2DataSource = YAHOO.util.DataSource; dtCategoriesDataSource = new yui2DataSource('/Administration/Category/JsonGetParentCategoryList'); dtCategoriesDataSource.responseType = yui2DataSource.TYPE_JSON; dtCategoriesDataSource.responseSchema = { resultsList: 'DataResultSet', fields: [ { key: 'Id', formatter: yui2DataTable.formatNumber }, { key: 'Name' }, { key: 'IsActiveDisplay' }, { key: 'Actions' } ] }; My action method to supply the data to the data table: Code: public ActionResult JsonGetParentCategoryList() { IEnumerable<Category> categoryList = categoryService.GetAll(); // Mapping IEnumerable<CategoryViewModel> viewModelList = (IEnumerable<CategoryViewModel>)categoryMapper.Map( categoryList, typeof(IEnumerable<Category>), typeof(IEnumerable<CategoryViewModel>) ); JsonEncapsulatorDto<CategoryViewModel> data = new JsonEncapsulatorDto<CategoryViewModel> { DataResultSet = viewModelList }; return Json(data, JsonRequestBehavior.AllowGet); } The data table is loaded in my Index view and a category is added on my Create view. Internet Explorer When I add a new category in IE then it gets added to the database, no issues with this. When the grid loads for the first time it goes into JsonGetParentCategoryList action method and populates the data table. If I were to refresh the page then it doesn't go into the JsonGetParentCategoryList action method, but the grid is still loaded. If I were to add another category and then go back to my data table then it doesn't want to load the newer categories (after the data table was loaded for the first time). FireFox In FireFox the opposite happens. When I load the Index for the first time the data table is loaded with categories. When I add a new category and go back to the data table then the newer categories are all loaded (even after the first time the grid was loaded). Why is this the case and how would I solve it? Is it something that needs to be set in IE? I hope not because if my website has many users then I can't go and tell every user to adjust the setting. Is it maybe something in the YUI data table that I need to set? |
Alberto SantiniYUI Contributor
|
Hello Brendan.
I am not used to the architecture you described. I think it depends on the logic of the data requery. You may give a look at the following example: http://satyam.com.ar/yui/2.6.0/requery.html Hope that helps, IceBox |
| Page 1 of 1 | [ 2 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group