Check the code n point the mistake

Posted by Vibha on Stack Overflow See other posts from Stack Overflow or by Vibha
Published on 2010-04-19T10:00:52Z Indexed on 2010/04/19 10:03 UTC
Read the original article Hit count: 200

Filed under:

here is the code: Ext.onReady(function(){ alert("inside onReady");

Ext.QuickTips.init();

var employee = Ext.data.Record.create([ {name:'firstname'}, {name:'lastname'}]);

var myReader = new Ext.data.JsonReader({ root:"EmpInfo", },employee);

var store = new Ext.data.JsonStore({ id:'ID' ,root:'EmpInfo' ,totalProperty:'totalCount' ,url:'test.php' ,autoLoad:true ,fields:[ {name:'firstname', type:'string'} ,{name:'lastname', type:'string'} ] });

var myPanel = new Ext.grid.GridPanel({ store: store ,columns:[{ dataIndex:'firstname' ,header:'First Name' ,width:139 },{ dataIndex:'lastname' ,header:'Middle Name' ,width:139 } ] });

var myWindow = new Ext.Window({ width:300, height:300, layout:'fit', closable:false, resizable:false, items:[myPanel] });

myWindow.show(); });

And php code is:

true, "data" => array( "firstname" => "ABC" , "lastname" => "MNO") ); $_SESSION["err"] = isset($_SESSION["err"]) ? !$_SESSION["err"] : true; header("Content-Type: application/json"); echo json_encode($o); ?>

I want to print the values ABC and MNO in the grid panel. i'm using extjs 2.3. please help me out. Thanks

© Stack Overflow or respective owner

Related posts about JavaScript