1. #1
    Sencha User fangzhouxing's Avatar
    Join Date
    Mar 2007
    Posts
    468
    Vote Rating
    2
    fangzhouxing is on a distinguished road

      0  

    Default How to reload dataView using MemoryProxy?

    How to reload dataView using MemoryProxy?


    My code to create dataview:
    Code:
            MemoryProxy proxy = new MemoryProxy(menuNavigator.getEntries());
            ListLoader loader = new BaseListLoader(proxy);
    
    	ListStore<ModelData> store = new ListStore<ModelData>(loader);
    	loader.load();
    
    	StringBuffer sb = new StringBuffer();
    	sb.append("<div class='menu-navigator-box'>");
    	sb.append("<div class='thumbd'><img src='{path}' width=128 height=128></div>");
    	sb.append("<div>{name}</div>");
    	sb.append("</div>");
    
    	dataView = new DataView();
    	dataView.setItemSelector(".menu-navigator-box");
    	dataView.setOverStyle("menu-navigator-over");
    	dataView.setSelectStyle("none");
    	dataView.setBorders(false);
    	dataView.setStore(store);
    	dataView.setTemplate(sb.toString());
    I want to change the content of dataView, the following code don't work:
    Code:
    	    MemoryProxy proxy = new MemoryProxy(menuNavigator.loadFilterEntries(menuNavigator,category.getName()));
    	    loader = new BaseListLoader(proxy);
    	    store = new ListStore<ModelData>(loader);
    	    loader.load();
    Any advice? Thanks in advance!

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    You need to reset the store on the dataview

  3. #3
    Sencha User fangzhouxing's Avatar
    Join Date
    Mar 2007
    Posts
    468
    Vote Rating
    2
    fangzhouxing is on a distinguished road

      0  

    Default


    but when I reset store of dataview by call setStore method, it throws an exception。

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Yes you are right. Dataview is not designed for that. I would suggest to use listview. You have the same features there but it works directly on a store.

Thread Participants: 1