[RAZOR] Repopulate the Model through Direct Method

  1. #1

    [RAZOR] Repopulate the Model through Direct Method

    I feel like I am missing something so simple, but have to ask it here as I cannot find answers anywhere.

    Lets say we have a simple customer search page, with a textfield and a gridpanel to show results.
    On the page, we have the model as @model List<Customer> The gridpanel's datasource is the model.
    (we are seeing this in 'Editable GridPanel With Save To [DirectMethod]' in your examples)

    Since we have not searched yet, the model is empty. Once a user clicks search button, we want to go to controller, get List<Customer> results, and repopulate the model through a direct event/method.

    It seems like you should be able to do something like return this.Direct(model) and this would pass the model back to the view and the store would load the results. But this is not working. The only way we can get it to work is to do Ext.getCmp(store) and store.LoadData(model). We are trying to avoid using getCmp and also do not want to use a partial view.

    It seems like something very common and simple, and any advice would be appreciated...
  2. #2
    Just use Proxy in the store and reload the store when search condition is changed
    See the following sample (just you need to pass search condition with load request )
    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. [CLOSED] Output Cache issue with Direct Method / Direct Event
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 18
    Last Post: Mar 01, 2013, 5:03 AM
  2. [CLOSED] Model Direct Event is not working after getting latest from the SVN
    By pawangyanwali in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 16, 2013, 1:39 PM
  3. Replies: 2
    Last Post: Aug 30, 2012, 9:37 PM
  4. [CLOSED] [Razor] Using Model in MVC View
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: May 02, 2012, 4:38 PM
  5. Direct method and direct event over SSL?
    By dimitar in forum 1.x Help
    Replies: 0
    Last Post: Oct 08, 2011, 8:09 PM

Tags for this Thread

Posting Permissions