Results 1 to 3 of 3

Thread: How To: Render a Ext.grid.Panel only after a Form Submit

  1. #1
    Sencha User
    Join Date
    Aug 2014
    Posts
    30
    Answers
    1

    Default How To: Render a Ext.grid.Panel only after a Form Submit

    Hello,

    First I want to say that I'm new to the ExtJs community and I dont have much time to implement this on my current project.

    I search a lot on google and here on forums but didn't found the solution, maybe somebody can help me.

    My scenario:
    * I use ExtJs with an ASP.Net MVC application.

    I have a Ext.TabPanel with 2 tabs, in each tab I have 2 forms with some filter fields for searching in my DB, and a Search and Clear buttons.

    All extjs grid examples that I found, the render occurs on Ext.onReady (at the page load), what I need to do is:
    On the load o my page, only render my search filter fields, and after I Click on "Search" button I need to call my server side method to load and render my Grid.Panel.

    eg.
    Code:
    Button.Click = function ( 
    myStore.load({ params: { page: 1, limit: 10} }); 
    myGrid.Render();
    Its clear ? How can I do that ? I have to use listeners ?

    ps: asp.net mvc examples would be great.

    Thanks
    Bruno

  2. #2
    Sencha User
    Join Date
    Aug 2014
    Posts
    30
    Answers
    1

    Default

    100 views and nothing =(

    Well, I could no do it like I wanted, but this works

    Code:
    buttons: [{
        id: 'btnSearch',
        text: 'Search',
        handler: function () {
        var date = Ext.getCmp('dateControl').getValue();
            store.load({ params: { page: 1, limit: 10, pDate: date} });
        }
    }]
    So, on my page load my grid still renders, but without values, I only call my store load method on click event.
    For now this is ok.

    cheers

  3. #3
    Sencha Premium User
    Join Date
    Mar 2011
    Posts
    287
    Answers
    35

    Default

    May be a moot point now, but to not show the grid, add this to its config:
    Code:
    hidden : true
    Then before your store.load() call, make it visible:
    Code:
    grid.setVisible(true);

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •