Results 1 to 3 of 3

Thread: How to auto Load Data into grid from the database.

  1. #1

    Default How to auto Load Data into grid from the database.

    I first insert data into Mysql Database from the Form and later I want to show it automatically show it data into grid panel using ajax. How can I implement it? any help would be greatly appreciated.

    ExtJS Coding:

    {
    xtype:'form',
    border: 2,
    bodyPadding: 10,
    bodyCls: 'ux-noframe-bg',
    width:300,
    title:'Create API',
    collapsible:true,
    collapseDirection: 'right',
    layout:'anchor',
    fieldDefaults: {
    labelWidth: 50,
    anchor: '100%'
    },
    items: [{
    //padding:10,
    xtype: 'textfield',
    itemId: 'keyNameField',
    fieldLabel: 'Code',
    labelClsExtra:'op5-spec-rsiveo-formapi-textfieldlabel',
    name: 'thecode'
    },{
    xtype: 'button',
    text: 'Create key',
    margin: "20 10 0 10",
    handler: function() {
    var txt = this.down('#keyNameField') ;
    var keyName = txt.getValue() ;
    this.submitKeyName(keyName) ;
    console.log(txt);


    },
    scope: this
    }],
    }]

    }


    PHP CODE :


    function specRsiRecouveo_apikey_create($post_data){
    global $_opDB ;
    //print_r($post_data['_keyName']) ;
    $data = array() ;



    // automatic Date function
    $datetime = new DateTime();
    $localtime=$datetime->format('Y-m-d H:i');

    //Auto generate Hexa Code 12 Digit
    $hexacode = dechex(rand(0x00000000, 0xFFFFFFFFFFFF));


    $query = "INSERT INTO view_file_Z_APIKEYS (field_APIKEY_CODE,field_APIKEY_DATE,field_APIKEY_HEX) VALUES ('{$post_data['_keyName']}','$localtime','$hexacode')" ;
    //print_r($_opD ;
    $result = $_opDB->query($query) ;


    return array('success'=>true, 'data'=>$data) ;

    }

    Database connect Backend:

    case 'apikey_create':
    return specRsiRecouveo_apikey_create( $post_data ) ;

    Please help me to solve this issue and Thanks advanced for your help.

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,005
    Answers
    5

    Default

    Sorry for the delay- I have sent your question to a team member that will be able to help you. Thanks for your patience!

  3. #3
    Sencha Staff
    Join Date
    Sep 2017
    Posts
    126
    Answers
    1

    Default

    Hello,


    You can load data into grid using store's load method or by setting autoload:true in store of your grid.


    Docs link - https://docs.sencha.com/extreact/6.5...ata.Store.html
    Fiddle showing store load - https://fiddle.sencha.com/#fiddle/12k2&view/editor

    Regards,
    Pavan.

    Sencha Support.

Similar Threads

  1. Load Data From Database to Ext JS 3 Checkbox
    By Hafizh_ff in forum Sencha Architect 3.x: Q&A
    Replies: 2
    Last Post: 18 Mar 2015, 6:47 PM
  2. Replies: 2
    Last Post: 28 Mar 2014, 12:09 PM
  3. Best way to auto load more data into a grid
    By Ueland in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 7 Nov 2011, 10:22 AM
  4. Load data from database to Store
    By mongolores in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 12 Feb 2011, 3:31 PM
  5. How to make formpanel to auto load data from database
    By afei in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 4 Aug 2008, 12:52 AM

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
  •