tzalberto
26 Jun 2013, 8:55 AM
Hi all,
I'm using treepanel with treecolumn to represent a File/Folder Tree Structure. My panel looks like:
var mypanel= Ext.create('Ext.tree.Panel', {
id: 'mypanel',
store: mystore,
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})
],
columns: {
items: [
{
xtype: 'treecolumn',
text: 'File Structure',
dataIndex: 'text',
editor: {
allowBlank: false
}
}
]
}
});
The 'text' field in mystore contains the name of the file/folder including extension.
When the user clicks on the filename, the column allows to edit it.
My problem is that when the user clicks to edit I need to show in the editor only the filename without the extension.
For example:
File: myfile.txt
The editor should only show myfile
How can I achieve this?
I have no problem with splitting the string to get the name and the extension. The problem is to configure the editor to show only the name. I tried to do it through the beforeedit event of the treepanel but I couldn't get it.
I'm using treepanel with treecolumn to represent a File/Folder Tree Structure. My panel looks like:
var mypanel= Ext.create('Ext.tree.Panel', {
id: 'mypanel',
store: mystore,
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})
],
columns: {
items: [
{
xtype: 'treecolumn',
text: 'File Structure',
dataIndex: 'text',
editor: {
allowBlank: false
}
}
]
}
});
The 'text' field in mystore contains the name of the file/folder including extension.
When the user clicks on the filename, the column allows to edit it.
My problem is that when the user clicks to edit I need to show in the editor only the filename without the extension.
For example:
File: myfile.txt
The editor should only show myfile
How can I achieve this?
I have no problem with splitting the string to get the name and the extension. The problem is to configure the editor to show only the name. I tried to do it through the beforeedit event of the treepanel but I couldn't get it.