1. #11
    Sencha User
    Join Date
    Jun 2012
    Posts
    32
    Vote Rating
    14
    plum will become famous soon enough

      1  

    Default


    Hi,

    You have to set url property of xtype dynamicGrid. So if you look into Viewport.js file you will see this lines:

    Code:
    {
         xtype: 'dynamicGrid',
         url: './data.js' //url to your json data
    }
    This is declaration of 'dynamicGrid' where url property is set to proper json data url.

  2. #12
    Sencha User
    Join Date
    Jul 2012
    Posts
    107
    Vote Rating
    -1
    sencha.user is an unknown quantity at this point

      0  

    Default


    Hi,

    Thanks for the reply, so I have to just set url property in Viewport.js? I did that, but it again fetches data from data.js, If I remove data.js and try again, it gives me 404 error, though data.js is not set as url property. I am really confused, do I have to change something in DynamicGrid.js or I cannot use PHP returning JSON or I can only use data.js as url property?

    Thanks in advance.

  3. #13
    Sencha User
    Join Date
    Jun 2012
    Posts
    32
    Vote Rating
    14
    plum will become famous soon enough

      1  

    Default


    I think you are setting url in inproper way becouse you are getting 404 so browser can't find your destination.

    E.g. if you have url to php file that is returning you json data like:

    http://localhost:8080/your_app/php/json_data.php

    Then you should declare dynamic grid:
    Code:
    {
          xtype: 'dynamicGrid',
          url: 'php/json_data.php'
    }
    folder structure:
    Code:
    your_app
    --- app
    --- ext
    --- ...
    --- php
           |
          --- json_data.php
    I think this is not problem of the dynamic grid addon, but that you are not setting properly url to your php file.

    You have to set url the same way like you do when you are setting url for normal Ext data Store.

    Also when you are changing js file check in browser developer tools that your changes was loaded becouse your browser can cache this.

  4. #14
    Sencha User
    Join Date
    Jul 2012
    Posts
    107
    Vote Rating
    -1
    sencha.user is an unknown quantity at this point

      0  

    Default


    Yea you are right, I have to clear cache when I change url property. Thank you very much for you help, this will help me with my requirement .

  5. #15
    Sencha User
    Join Date
    Oct 2012
    Posts
    8
    Vote Rating
    0
    diet1986 is on a distinguished road

      0  

    Default


    Hello Lukas,

    The grid will be updated with all columns is the data source .Is there any way so that we can restrict the column according to our convention

  6. #16
    Sencha User
    Join Date
    Jun 2012
    Posts
    32
    Vote Rating
    14
    plum will become famous soon enough

      0  

    Default


    Quote Originally Posted by diet1986 View Post
    Hello Lukas,

    The grid will be updated with all columns is the data source .Is there any way so that we can restrict the column according to our convention
    I especially not expanded the code to this kind of soluctions becouse anyone can have different ideas that match their requirements.

    Your requirement can be resolved in two ways. Visible columns can be defined in returned json data from server [metadata or something like that] or defined in dynamic grid grid in some custom property.

    I created for you example how to achieve second soluction.
    Look into my github account [visibleColumns branch]
    https://github.com/nonameplum/DynamicGrid/tree/visibleColumns

    In exacly the same way you could provide e.g. names for columns if you want to provide other names than json properies names.

    Hope this help you understand how to extend my addon to your requirements.

    Best regards.

  7. #17
    Sencha User
    Join Date
    Aug 2012
    Posts
    1
    Vote Rating
    0
    GIS_FLY is on a distinguished road

      0  

    Default


    Thank you for sharing your code.

  8. #18
    Sencha User
    Join Date
    Oct 2012
    Posts
    8
    Vote Rating
    0
    diet1986 is on a distinguished road

      0  

    Default


    Hello Lukas,
    Thanks for your help. As you suggested i am sending my column names in a json .I want to use grid.reconfigure(store,column[]) .Can you please suggest me how to get the columns from json .Below is my json.Below response is coming on load of a store that i have already created .Below are the store and json response.

    Code:
    {"gridcolumns":["CustomerNumber","SupplierNumber","Party1ItemNumber","Party2ItemNumber","ItemDescription","Currency","BaseUOM","Price","StartDate","EndDate","ActiveFlag","validationErrors"],"data":[{"class":"tpsyndev.TempDomainToFetchData","id":null,"activeFlag":"Y","baseUOM":"EA","currency":"USD","customerNumber":"","endDate":null,"itemDescripton":"BestBuyItem123","party1Id":null,"party1ItemNumber":"","party2Id":null,"party2ItemNumber":"uyhln","price":100.23,"processRunDetailsId":12,"startDate":"2012-11-07T08:02:47Z","supplierNumber":"","validations":"Please provide supplier number at row number 1 Column number 2Please provide customer number at row number 1column number 1Unknown Sponsor party at row number 1Please enter valid party1itemnumber number at row number 1column number 3"},{"class":"tpsyndev.TempDomainToFetchData","id":null,"activeFlag":"Y","baseUOM":"EA","currency":"USD","customerNumber":"BEST","endDate":null,"itemDescripton":"BestBuyItem456","party1Id":3,"party1ItemNumber":"gjhkjj","party2Id":4,"party2ItemNumber":"jlk","price":100.23,"processRunDetailsId":12,"startDate":"2012-11-07T08:02:47Z","supplierNumber":"GWILL","validations":""},{"class":"tpsyndev.TempDomainToFetchData","id":null,"activeFlag":"Y","baseUOM":"EA","currency":"USD","customerNumber":"BEST","endDate":null,"itemDescripton":"BestBuyItem789","party1Id":3,"party1ItemNumber":"gdggjhkj","party2Id":4,"party2ItemNumber":"jkjlkjl","price":100.23,"processRunDetailsId":12,"startDate":"2012-11-07T08:02:47Z","supplierNumber":"GWILL","validations":""},{"class":"tpsyndev.TempDomainToFetchData","id":null,"activeFlag":"Y","baseUOM":"EA","currency":"USD","customerNumber":"BEST","endDate":null,"itemDescripton":"BestBuyItem23","party1Id":3,"party1ItemNumber":"jhbjbkn","party2Id":4,"party2ItemNumber":"fjkkjk","price":100.23,"processRunDetailsId":12,"startDate":"2012-11-07T08:02:47Z","supplierNumber":"GWILL","validations":""},{"class":"tpsyndev.TempDomainToFetchData","id":null,"activeFlag":"Y","baseUOM":"EA","currency":"USD","customerNumber":"BEST","endDate":null,"itemDescripton":"BestBuyItem156","party1Id":3,"party1ItemNumber":"hvbjkn","party2Id":4,"party2ItemNumber":"jgfjgj","price":100.23,"processRunDetailsId":12,"startDate":"2012-11-07T08:02:47Z","supplierNumber":"GWILL","validations":""},{"class":"tpsyndev.TempDomainToFetchData","id":null,"activeFlag":"Y","baseUOM":"EA","currency":"USD","customerNumber":"BEST","endDate":null,"itemDescripton":"BestBuyItem189","party1Id":3,"party1ItemNumber":"yfjbjhk","party2Id":4,"party2ItemNumber":"hjhkjl","price":100.23,"processRunDetailsId":12,"startDate":"2012-11-07T08:02:47Z","supplierNumber":"GWILL","validations":""},{"class":"tpsyndev.TempDomainToFetchData","id":null,"activeFlag":"Y","baseUOM":"EA","currency":"USD","customerNumber":"BEST","endDate":null,"itemDescripton":"BestBuyItem143","party1Id":3,"party1ItemNumber":"jjhhkkj","party2Id":4,"party2ItemNumber":"gjhjkhk","price":100.23,"processRunDetailsId":12,"startDate":"2012-11-07T08:02:47Z","supplierNumber":"GWILL","validations":""},{"class":"tpsyndev.TempDomainToFetchData","id":null,"activeFlag":"Y","baseUOM":"EA","currency":"USD","customerNumber":"BEST","endDate":null,"itemDescripton":"BestBuyItem109","party1Id":3,"party1ItemNumber":"yjgjjhj","party2Id":4,"party2ItemNumber":"ggjgjk","price":100.23,"processRunDetailsId":12,"startDate":"2012-11-07T08:02:47Z","supplierNumber":"GWILL","validations":""}]}My Store is Ext.define('tpsyndev.store.tempPartyRelations', {
        extend: 'Ext.data.Store',
        alias: 'widget.tempPartiesRelations',
        model:'tpsyndev.model.TempPartyRelation',
        autoLoad: false,
        pageSize: 4,
        proxy: {
            type: 'ajax',
            url : '/tpsyndev/MainLayout/dgetTempPartyRelations',
            reader: {
                type: 'json',
                root: 'data',
            }
        }
    });
    Quote Originally Posted by plum View Post
    I especially not expanded the code to this kind of soluctions becouse anyone can have different ideas that match their requirements.

    Your requirement can be resolved in two ways. Visible columns can be defined in returned json data from server [metadata or something like that] or defined in dynamic grid grid in some custom property.

    I created for you example how to achieve second soluction.
    Look into my github account [visibleColumns branch]
    https://github.com/nonameplum/DynamicGrid/tree/visibleColumns

    In exacly the same way you could provide e.g. names for columns if you want to provide other names than json properies names.

    Hope this help you understand how to extend my addon to your requirements.

    Best regards.

  9. #19
    Sencha User
    Join Date
    Jun 2012
    Posts
    32
    Vote Rating
    14
    plum will become famous soon enough

      0  

    Default


    diet1986
    created second topic related to his question here -> http://www.sencha.com/forum/showthre...er-json-object

  10. #20
    Sencha User
    Join Date
    Jul 2012
    Posts
    107
    Vote Rating
    -1
    sencha.user is an unknown quantity at this point

      0  

    Default


    Hi Lukas,

    Can we use this dynamic model extention in Sencha Architect? How that should be done? Please help.

    Thanks!