Results 1 to 2 of 2

Thread: Problem with filter grid

  1. #1
    Sencha User
    Join Date
    May 2008
    Posts
    4
    Vote Rating
    0
      0  

    Question Problem with filter grid

    I'm create simple xml filter grid, but error appear. FireBug writing "this.config[A] has no properties
    /resources/js/ext.js
    Line 427"
    ext.js contains all modules. Version 2.1
    main.html:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
    <link rel="stylesheet" type="text/css" href="resources/css/xtheme-gray.css" />
    <title>mcpay ext</title>
    <script type="text/javascript" src="resources/js/ext.js"></script>
    
    <script type="text/javascript" src="resources/js/GridFilters.js"></script>
    <script type="text/javascript" src="resources/js/filter/Filter.js"></script>
    <script type="text/javascript" src="resources/js/filter/StringFilter.js"></script>
    <script type="text/javascript" src="resources/js/filter/DateFilter.js"></script>
    <script type="text/javascript" src="resources/js/filter/ListFilter.js"></script>
    <script type="text/javascript" src="resources/js/filter/NumericFilter.js"></script>
    <script type="text/javascript" src="resources/js/filter/BooleanFilter.js"></script>
    
    <script type="text/javascript" src="resources/js/menu/EditableItem.js"></script>
    <script type="text/javascript" src="resources/js/menu/RangeMenu.js"></script>
    
    <script type="text/javascript" src="resources/js/grid.js"></script>
    </head>
    <body>
    
    <div id="full-info"></div>
    
    </body>
    </html>
    grid.js:
    Code:
    Ext.onReady(function(){
    	Ext.menu.RangeMenu.prototype.icons = {
    	  gt: 'resources/images/greater_then.png', 
    	  lt: 'resources/images/less_then.png',
    	  eq: 'resources/images/equals.png'
    	};
    	Ext.grid.filter.StringFilter.prototype.icon = 'resources/images/find.png';
    	Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
    	
    	var Terminal = Ext.data.Record.create([
    		{name: 'number'},
    		{name: 'address'},
    		{name: 'place'},
    		{name: 'price'},
    		{name: 'time_on'},
    		{name: 'time_off'},
    		{name: 'weekend'},
    		{name: 'paycount_yday'},
    		{name: 'paysum_yday'},
    		{name: 'paysum_yweek'},
    		{name: 'validator'},
    		{name: 'network'},
    		{name: 'category'},
    		{name: 'technick'}
    	]);
    	
    	var xr = new Ext.data.XmlReader(
    	  {record: 'terminal'},
          Terminal
    	);
    
    	var ds = new Ext.data.Store({
    	  url: 'data2.php',
    	  reader: xr,
    	  sortInfo: {field: 'number', direction: 'ASC'},
    	  remoteSort: true
    	});
    
    	var filters = new Ext.grid.GridFilters({
    	  filters:[
    	    {type: 'numeric',  dataIndex: 'number'},
    	    {type: 'string',  dataIndex: 'address'},
    	    {type: 'string',  dataIndex: 'place'},
    	    {type: 'numeric', dataIndex: 'price'},
    	    {type: 'string',  dataIndex: 'time_on'},
    	    {type: 'string',  dataIndex: 'time_off'},
    	    {type: 'string',  dataIndex: 'weekend'},
    	    {type: 'numeric',  dataIndex: 'paycount_yday'},
    	    {type: 'numeric',  dataIndex: 'paysum_yday'},
    	    {type: 'numeric',  dataIndex: 'paysum_yweek'},
    	    {
    	      type: 'list',
    	      dataIndex: 'validator',
    	      options: ['1000', '1500'],
    	      phpMode: true
    	    },
    	    {
    	      type: 'list',  
    	      dataIndex: 'network', 
    	      options: ['МТС', 'Мегафон', 'Скайлинк', 'Локалка'],
    	      phpMode: true
    	    },
    	    {
    	      type: 'list',
    	      dataIndex: 'category',
    	      options: ['0', '1'],
    	      phpMode: true
    	    },
    	    {
    	      type: 'list',
    	      dataIndex: 'technick',
    	      options: ['0', '1'],
    	      phpMode: true
    	    }
    	  ]
    	});
    	
    	var cm = new Ext.grid.ColumnModel([
    	  {dataIndex: 'number', header: "number"},
    	  {dataIndex: 'address', header: "address"},
    	  {dataIndex: 'place', header: "place"},
    	  {dataIndex: 'price', header: "price"},
    	  {dataIndex: 'time_on', header: "time_on"},
    	  {dataIndex: 'time_off', header: "time_off"},
    	  {dataIndex: 'weekend', header: "weekend"},
    	  {dataIndex: 'paycount_yday', header: "paycount_yday"},
    	  {dataIndex: 'paysum_yday', header: "paysum_yday"},
    	  {dataIndex: 'paysum_yweek', header: "paysum_yweek"},
    	  {dataIndex: 'validator', header: "validator"},
    	  {dataIndex: 'network', header: "network"},
    	  {dataIndex: 'category', header: "category"},
    	  {dataIndex: 'technick', header: "technick"}
    	]);
    	cm.defaultSortable = true;
    	
    	var grid = new Ext.grid.GridPanel({
    	  id: 'example',
    	  title: 'qq',
    	  ds: ds,
    	  cm: cm,
    	  enableColLock: false,
    	  loadMask: true,
    	  plugins: filters,
    	  height:400,
    	  width:700,        
    	  el: 'full-info',
          autoExpandColumn: 'address',
    	  bbar: new Ext.PagingToolbar({
    	    store: ds,
    	    pageSize: 15,
    	    plugins: filters
    	  })
    	});
    	grid.render();
    	
    	ds.load({params:{start: 0, limit: 15}});
    });
    What's wrong?
    Thanks!

  2. #2
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    8
      0  

    Default

    Suggestions:
    1. start with smaller examples, I suspect you copied that code from someone else and are modifying blindly.
    2. see the learn section, both introduction to ext and the FAQ as they explain how to include files properly. You'll save yourself a lot of future hardship if you spend a little bit of time there now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •