ExtjsExt. data. Store usage problems

Source: Internet
Author: User
ExtjsExt. data. I recently used the Extjs template. if you have any questions, I 'd like to ask you how to use Ext. data. store reads data from the server and does not display anything on the front-end. The following is my background code: PHPcodefunctionactionReadAllDep () Extjs Ext. data. Store usage problems
Hello everyone, I recently used the Extjs template and encountered a problem. I 'd like to ask you, I am using Ext. data. store reads data from the server and does not display anything on the front-end.
The following is my background code:
PHP code
      function actionReadAllDep()    {        $pageLimit = getPageLimit();        $erp = new ModelErp();        $sql = "SELECT * FROM es_dep_pro";        $dep = $erp->getList($sql,$pageLimit['form'],$pageLimit['to']);        $result['totalCount'] = count($dep);        $result['topics'] = $dep;        require(CFG_PATH_LIB.'util/JSON.php');        $json = new Services_JSON();        echo $json->encode($result);    }


The following is the front-end code:
JScript code
  Ext. onReady (function () {var ds = new Ext. data. Store ({proxy: new Ext. data. HttpProxy ({url: 'Index. php? Model = erp & action = ReadAllDep & '}), reader: new Ext. data. jsonReader ({root: 'topics ', totalProperty: 'totalcount'}, ['Depp _ id', 'dep_name', 'uppper _ id ', 'status'])}); var cm = new Ext. grid. columnModel ([{header: "Department No.", width: 80, dataIndex: "DEP_ID"}, {header: "Department name", width: 100, dataIndex: "DEP_NAME" },{ header: "superior department ID", width: 80, dataIndex: "UPPER_ID" },{ header: "department status", width: 30, dataIndex: "STATUS"}]); cm. defaultSortable = true;/* var grid = new Ext. grid. gridPanel ({region: 'center', loadMask: true, store: ds, cm: cm, stripeRows: true, border: true, borderStyle: 'width: 100 ', autoScroll: true}); */ds. load ({params: {start: 0, limit: 20 }); loadend ();});


------ Solution --------------------
Shi Dafu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.