1. #1
    Sencha User
    Join Date
    May 2010
    Posts
    168
    Vote Rating
    1
    Dmoney is on a distinguished road

      0  

    Default how does namespace work now?

    how does namespace work now?


    Is there any documentation on how namespace works in 4?

    In 3.X I would have a panel in seperate js file with a namespace at the top like : Ext.ns('testPanel'); the testPanel file would have my grid and my store etc. my store is declared like :

    Code:
    testPanel.store = new Ext.data.Store({
    then in another js file I would have Ext.ns('forms');

    with a window and a form. This part still works but when I try reloading the store from the form it no longer works for me.

    testPanel.store.reload();

    in beta 1 it would say that testPanel.store didn't exist. in Beta 2 nothing happens at all.

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    80
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Are you using namespace to manage your application class instances?!?

  3. #3
    Sencha User
    Join Date
    May 2010
    Posts
    168
    Vote Rating
    1
    Dmoney is on a distinguished road

      0  

    Default


    I no longer think this is a problem with namespace. If I do this

    Code:
        staff.store.load({
            params: {
                start: 0,
                limit: 50
            }
        });
    
    
    staff.store.reload();
    the store loads like expected but for the reload I get a firebug error staff.store.reload is not a function.

    on a separate note setting limit doesn't work in the load params. limit 25 is always sent to the server no matter.

  4. #4
    Ext JS Premium Member syscobra's Avatar
    Join Date
    Nov 2007
    Location
    Venezuela
    Posts
    140
    Vote Rating
    0
    syscobra is on a distinguished road

      0  

    Default


    I think you can use Ext.create('testPanel.store', new Ext.data.Store(...

    That will create the namespace for you.
    If that doesn't work, the namespace in JS i think is something like:

    testPanel = {};

    so that will create a namespace called testPanel...
    Javier Rincón aka SysCobra

  5. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Vote Rating
    827
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You know the reload method is no longer in ExtJS4 right?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #6
    Sencha User
    Join Date
    May 2010
    Posts
    168
    Vote Rating
    1
    Dmoney is on a distinguished road

      0  

    Default


    Hey Mitchell yeah that was my problem.

    do you know if there is a different method of passing params to the store now?

    Code:
     staff.store.load({
            params: {
                start: 10,
                limit: 50
            }
        });
    the params that are sent always default to the following:

    params sent :
    limit 25
    page 1
    start 0

  7. #7
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Vote Rating
    827
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    If you are wanting to use paging, then you can use the nextPage, previousPage, or loadPage functions. To set the page size, as a config option of your Store, set the pageSize option:

    Code:
    new Ext.data.Store({
        ...
        pageSize: 25
    });
    If you are wanting to specify your own params along with the default paging ones (I'm sure you know this one):

    Code:
    store.load({
        ...
        params: {
            something: "Hello"
        }
    });
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  8. #8
    Sencha User
    Join Date
    May 2010
    Posts
    168
    Vote Rating
    1
    Dmoney is on a distinguished road

      0  

    Default


    Thanks Mitchell for the reply. I didn't realize that setting limit in the params was deprecated in 3 as well. It's what I've been doing all along.

    setting pageSize:50, in the store is what I needed.

    Thanks for all your help.

Similar Threads

  1. ux namespace
    By actonwang in forum Community Discussion
    Replies: 3
    Last Post: 18 Oct 2010, 9:00 AM
  2. Ext Namespace
    By gurufaction in forum Ext 3.x: Help & Discussion
    Replies: 8
    Last Post: 9 Jul 2009, 4:55 AM
  3. Help NameSpace
    By andylah in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 19 Jun 2008, 8:18 PM
  4. Sub : Ext.namespace
    By JDevloper in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 3 Mar 2008, 7:30 AM
  5. Ext.namespace
    By Wylde in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 5 Aug 2007, 8:59 AM

Thread Participants: 3