Results 1 to 2 of 2

Thread: error in action colum

  1. #1
    Sencha User
    Join Date
    Oct 2010
    Location
    Bangalore
    Posts
    52

    Default error in action colum

    hi,
    im using the following code, while executing im getting the error in ext.all for checkbox even im getting same error while using action colum

    HTML Code:
    <html>
    <head>
    <title>Hello World Window</title>
    <link rel="stylesheet" type="text/css" href="../Ext/resources/css/ext-all.css" />
    <script type="text/javascript" src="../Ext/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="../Ext/ext-all.js"></script>
    </head>
    
    <body>
    <script type="text/javascript"> 
     Ext.onReady(function(){
        /**
         * Handler specified for the 'Available' column renderer
         * @param {Object} value
         */
        function formatDate(value){
            return value ? value.dateFormat('M d, Y') : '';
        }
        // shorthand alias
        var fm = Ext.form;
        // the column model has information about grid columns
        // dataIndex maps the column to the specific data field in
        // the data store (created below)
        var cm = new Ext.grid.ColumnModel({
            // specify any defaults for each column
            defaults: {
                sortable: true // columns are not sortable by default           
            },
            columns: [{
                id: 'common',
                header: 'Common Name',
                dataIndex: 'common',
                width: 220,
                // use shorthand alias defined above
                editor: new fm.TextField({
                    allowBlank: false
                })
            }, {
                header: 'Light',
                dataIndex: 'light',
                width: 130,
                editor: new fm.ComboBox({
                    typeAhead: true,
                    triggerAction: 'all',
                    // transform the data already specified in html
                    transform: 'light',
                    lazyRender: true,
                    listClass: 'x-combo-list-small'
                })
            }, {
                header: 'Price',
                dataIndex: 'price',
                width: 70,
                align: 'right',
                renderer: 'usMoney',
                editor: new fm.NumberField({
                    allowBlank: false,
                    allowNegative: false,
                    maxValue: 100000
                })
            }, {
                header: 'Available',
                dataIndex: 'availDate',
                width: 95,
                renderer: formatDate,
                editor: new fm.DateField({
                    format: 'm/d/y',
                    minValue: '01/01/06',
                    disabledDays: [0, 6],
                    disabledDaysText: 'Plants are not available on the weekends'
                })
            }, {
                xtype: 'checkcolumn',
                header: 'Indoor?',
                dataIndex: 'indoor',
                width: 55
            }]
        });
        // create the Data Store
        var store = new Ext.data.Store({
            // destroy the store if the grid is destroyed
            autoDestroy: true,
            // load remote data using HTTP
            url: 'plants.xml',
            // specify a XmlReader (coincides with the XML format of the returned data)
            reader: new Ext.data.XmlReader({
                // records will have a 'plant' tag
                record: 'plant',
                // use an Array of field definition objects to implicitly create a Record constructor
                fields: [
                    // the 'name' below matches the tag name to read, except 'availDate'
                    // which is mapped to the tag 'availability'
                    {name: 'common', type: 'string'},
                    {name: 'botanical', type: 'string'},
                    {name: 'light'},
                    {name: 'price', type: 'float'},             
                    // dates can be automatically converted by specifying dateFormat
                    {name: 'availDate', mapping: 'availability', type: 'date', dateFormat: 'm/d/Y'},
                    {name: 'indoor', type: 'bool'}
                ]
            }),
            sortInfo: {field:'common', direction:'ASC'}
        });
        // create the editor grid
        var grid = new Ext.grid.EditorGridPanel({
            store: store,
            cm: cm,
            renderTo: 'editor-grid',
            width: 600,
            height: 300,
            autoExpandColumn: 'common', // column with this id will be expanded
            title: 'Edit Plants?',
            frame: true,
            clicksToEdit: 1,
            tbar: [{
                text: 'Add Plant',
                handler : function(){
                    // access the Record constructor through the grid's store
                    var Plant = grid.getStore().recordType;
                    var p = new Plant({
                        common: 'New Plant 1',
                        light: 'Mostly Shade',
                        price: 0,
                        availDate: (new Date()).clearTime(),
                        indoor: false
                    });
                    grid.stopEditing();
                    store.insert(0, p);
                    grid.startEditing(0, 0);
                }
            }]
        });
        // manually trigger the data store load
        store.load({
            // store loading is asynchronous, use a load listener or callback to handle results
            callback: function(){
                Ext.Msg.show({
                    title: 'Store Load Callback',
                    msg: 'store was loaded, data available for processing',
                    modal: false,
                    icon: Ext.Msg.INFO,
                    buttons: Ext.Msg.OK
                });
            }
        });
    });
     </script> 
      
        <!-- the custom editor for the 'Light' column references the id="light" -->
        <select name="light" id="light" style="display: none;">
          <option value="Shade">Shade</option>
          <option value="Mostly Shady">Mostly Shady</option>
          <option value="Sun or Shade">Sun or Shade</option>
          <option value="Mostly Sunny">Mostly Sunny</option>
          <option value="Sunny">Sunny</option>
        </select>
    <div id="editor-grid"></div>
    </body>
    </html>

    the error is object expected at line 11 in ext.all



    can any one help me..........

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    checkcolumn isn't part of ext-all.js. You need to include examples/ux/CheckColumn.js.

    actioncolumn is part of ext-all.js, but only in Ext 3.3+. Which Ext version are you using?

Similar Threads

  1. JS Error-Object does not support this action
    By lopita in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 7 Aug 2009, 6:35 AM
  2. Form layout error after 'Load' action in IE6
    By ufoinspace in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 7 Dec 2007, 1:12 AM

Posting Permissions

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