I want with extjs 4.2
I use this component in attachment :
{
xtype: 'filefield',
id: 'file6',
fieldLabel: 'test ',
labelWidth: 100,
msgTarget: 'side',
allowBlank : false,
anchor: '100%',
buttonText: 'upload'
},
I want to have a attachment component which display name of file without this text : c /fakepath
Similar to user3550464's answer, but in a whole lot less code:
Add this to your file field listeners object. This code will remove all text up to and including the last slash or backslash in the field.
Here is an improvement based on weeksdev's answer. Add the following listener to your file field:
There isn't a built-in way to accomplish this however, you can do a find/replace for fakepath and remove. I impelmented this on the
change
event. Here is an example:I created a sencha fiddle demonstrating a working example