私はこれを行うには最適なソリューションを探しています。私が持っているもの :私はセルにdoublecickときオブジェクト値のCelleditor Extjs4
// model
Ext.define("User", {
extend: "Ext.data.Model",
fields: [
{name: "id", type: "int"},
{name: "name"},
{name: "description", type: "string"}
]
});
// store with data
var oStore = new Ext.data.Store({
model: "User",
data: [
{id: 1, name: {name:"John"}, description: "Fapfapfap"},
{id: 2, name: {name:"Danny"}, description: "Boobooboo"},
{id: 3, name: {name: "Tom"}, description: "Tralala"},
{id: 4, name: {name:"Jane"}, description: "Ololo"},
]
});
// and finally I have a grid panel
Ext.create("Ext.grid.Panel", {
columns: [
{dataIndex: "id", header:"ID"},
{
dataIndex: "name",
header: "Name",
renderer: function(value){return value.name;},
editor: "textfield"},
{dataIndex: "description", header: "Description", flex: 1, editor: "htmleditor"}
],
plugins: [new Ext.grid.plugin.CellEditing({clicksToEdit: 2})],
store: store,
renderTo: document.body
});
私は、エディタのフィールドに[object] Object
を見て、私は、グリッド内の空のセルを参照してくださいよりも、有効な値を入力するとき。
質問:どうすればcelleditorをrecord.name
からではなく、record.name.name
からデータを取得するように設定できますか?
興味深いアプローチ:) – dbrin
このアプローチは私に役立ちます=)thx –
マッピングプロパティを使用してフィールドをディープリンクするのはなぜですか?{name: "name"、mapping: 'name.name'} - 場所。 – dbrin