Results 1 to 2 of 2

Thread: Grid SelModel - Sencha Architect - Modern - Ext JS 6.6

  1. #1
    Sencha User
    Join Date
    Jan 2019
    Posts
    1

    Default Grid SelModel - Sencha Architect - Modern - Ext JS 6.6

    Hello! I'm new in Sencha. I need selectable grid, and need get data of this select grid.

    How i Can Add : selModel: {selType: 'rowmodel', mode: 'SIMPLE'}, on ARCHITECT? Where i must do this... i can't paste code, i cant change code manually.

    Now i can't use getSelectionmodel...

    senchaerror.jpg

    Can you help me? Thanks...

    This is code my button function:

    Code:
    var grid = Ext.getCmp("KlienciGridSel");
           var selectionModel = grid.getSelectionModel();
           var selectedRecords = selectionModel.getSelection();
           if (selectedRecords.length>0) {
              var myValue = selectedRecords[0].get('id');
           alert(myValue);
           } else alert('nic nie wybrano');
    This is code my grid:

    Code:
    Ext.define('SamiSwoi.view.grid.KlienciGrid', {
        extend: 'Ext.grid.Grid',
        alias: 'widget.grid.kliencigrid',
    
    
        requires: [
            'SamiSwoi.view.grid.KlienciGridViewModel',
            'SamiSwoi.view.grid.KlienciGridViewController',
            'Ext.grid.column.Column',
            'Ext.SegmentedButton',
            'Ext.Button'
        ],
    
    
        controller: 'grid.kliencigrid',
        viewModel: {
            type: 'grid.kliencigrid'
        },
        reference: 'KlienciGrid',
        height: '100%',
        id: 'KlienciGridSel',
        itemId: '',
        name: 'KlienciGrid',
        width: '100%',
        selectable: {
            checkbox: true
        },
        store: 'KlienciData',
    
    
        columns: [
            {
                xtype: 'gridcolumn',
                hidden: true,
                dataIndex: 'ID',
                text: 'ID'
            },
            {
                xtype: 'gridcolumn',
                items: [
                    {
                        xtype: 'searchtrigger',
                        autoSearch: true
                    }
                ],
                dataIndex: 'Nazwa',
                defaultWidth: 300,
                text: 'Nazwa'
            },
            {
                xtype: 'gridcolumn',
                dataIndex: 'Skrot',
                defaultWidth: 200,
                text: 'Skrot'
            },
            {
                xtype: 'gridcolumn',
                dataIndex: 'Nip',
                text: 'Nip'
            },
            {
                xtype: 'gridcolumn',
                dataIndex: 'Adres',
                defaultWidth: 500,
                text: 'Adres'
            }
        ],
        items: [
            {
                xtype: 'segmentedbutton',
                name: 'PrzyciskiZarz',
                docked: 'top',
                items: [
                    {
                        xtype: 'button',
                        iconCls: 'x-fa fa-user-plus',
                        text: 'Dodaj klienta',
                        listeners: {
                            tap: 'onAddKlientTap'
                        }
                    },
                    {
                        xtype: 'button',
                        iconCls: 'x-fa fa-pencil',
                        text: 'Edytuj klienta',
                        listeners: {
                            tap: 'onEditKlientTap'
                        }
                    },
                    {
                        xtype: 'button',
                        iconCls: 'x-fa fa-user-times',
                        text: 'Skasuj klienta',
                        listeners: {
                            tap: 'onRemoveKlientTap'
                        }
                    }
                ]
            }
        ]
    
    
    });

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,006

    Default

    Hello there- thank you for providing all the information. I have shared this with the support team and asked that someone reach out to provide some assistance as soon as possible. Your patience is greatly appreciated.

    Thanks,

    Michele

Similar Threads

  1. Reconfigure grid in sencha modern
    By bmacdon1 in forum Ext JS 6.x Q&A
    Replies: 2
    Last Post: 2 Jul 2018, 9:55 AM
  2. Replies: 4
    Last Post: 23 Jan 2017, 8:35 PM
  3. sencha 6: how to switch selModel after grid load?
    By xnathan in forum Ext JS 6.x Q&A
    Replies: 4
    Last Post: 20 Apr 2016, 4:29 PM

Posting Permissions

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