第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

ExtJS 數(shù)據(jù)重新加載后如何恢復(fù)網(wǎng)格焦點(diǎn)?

ExtJS 數(shù)據(jù)重新加載后如何恢復(fù)網(wǎng)格焦點(diǎn)?

達(dá)令說(shuō) 2023-09-14 22:05:39
我在 ExtJS 中有一個(gè)視圖,其中包含一個(gè)網(wǎng)格,用戶可以在其中選擇一個(gè)條目以及一些包含當(dāng)前所選行詳細(xì)信息的面板。每次選擇另一行時(shí),都會(huì)重新加載視圖,這會(huì)導(dǎo)致網(wǎng)格失去鍵盤(pán)導(dǎo)航的輸入焦點(diǎn)。如何重新加載網(wǎng)格存儲(chǔ)數(shù)據(jù)并使輸入焦點(diǎn)保持在網(wǎng)格上?我的模型定義了idProperty,因此選擇了正確的行,但列選擇和輸入焦點(diǎn)丟失了。我正在使用 ExtJS v7.3.0.55 和 Classic Triton 主題。例子使用 JSON Store Sencha Fiddle 和數(shù)據(jù)模型和一些網(wǎng)格事件監(jiān)聽(tīng)器擴(kuò)展現(xiàn)有網(wǎng)格中的代碼以重現(xiàn)該問(wèn)題:Ext.application({    name: 'Fiddle',    launch: function () {        // My data model with custom ID field        Ext.define('User', {            extend: 'Ext.data.Model',            fields: [                {name: 'name',  type: 'string'},                {name: 'email', type: 'string'},                {name: 'phone', type: 'string'},            ],            idProperty: 'email',        });        Ext.create('Ext.data.Store', {            storeId: 'simpsonsStore',            model: 'User',            proxy: {                type: 'ajax',                // Loading data from ./simpsons.json in the fiddle ./Data folder.                url: 'simpsons.json',                reader: {                    type: 'json',                    rootProperty: 'items'                }            }        });        Ext.create('Ext.grid.Panel', {            renderTo: Ext.getBody(),            height: 300,            width: "100%",            title: 'Simpsons',            store: 'simpsonsStore',            autoLoad: true,            columns: [{                text: 'Name',                dataIndex: 'name'            }, {                text: 'Email',                dataIndex: 'email',                flex: 1            }, {                text: 'Phone',                dataIndex: 'phone'            }],
查看完整描述

1 回答

?
搖曳的薔薇

TA貢獻(xiàn)1793條經(jīng)驗(yàn) 獲得超6個(gè)贊

嘗試將選擇放入商店的加載處理程序中:


Ext.create('Ext.grid.Panel', {

    renderTo: Ext.getBody(),

    height: 300,

    width: "100%",

    title: 'Simpsons',


    // Using Named Store

    store: 'simpsonsStore',


    // Load the data

    autoLoad: true,


    columns: [{

        text: 'Name',

        dataIndex: 'name'

    }, {

        text: 'Email',

        dataIndex: 'email',

        flex: 1

    }, {

        text: 'Phone',

        dataIndex: 'phone'

    }],

    listeners: {

        select: function (selectionRowModel, selectedRecord, selectedIndex) {

            var store = selectionRowModel.getStore();

            store.on('load', function(store) {

                selectionRowModel.select(selectedIndex, true, true);

            }, this, {

                single: true

            })

            store.load();

        }

    }

});


查看完整回答
反對(duì) 回復(fù) 2023-09-14
  • 1 回答
  • 0 關(guān)注
  • 90 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)