PDA

View Full Version : [CLOSED] GridPanel DragText placeholders



avante
Feb 22, 2013, 10:37 AM
Hello!

I realized in the documentation of DragDrop plugin that there are two two placeholders, as the following text:

dragText : String
The text to show while dragging.

Two placeholders can be used in the text:

{0} The number of selected items.
{1} 's' when more than 1 items (only useful for English).
Defaults to: '{0} selected row{1}'

Available since: Ext 4.1.1

I need to know how can I create a new placeholder "{2}" with "es" value when more than 1 items are selected?

Thanks.

Vladimir
Feb 22, 2013, 10:50 AM
Do you use Ext.Net v1.x?
If yes then that option is not available because latest v1.x (1.6) version uses ExtJs 3.4 but that option is avaible since ExtJS 4 only

avante
Feb 22, 2013, 10:58 AM
I'm using Ext.Net version 2.1.0.

Is it possible in this version?

Thanks for your quickly response.

Vladimir
Feb 22, 2013, 11:05 AM
Please post v2.x question in 2.x Premium Help forum branch
You need to use the following override to add {2} support


Ext.view.DragZone.override({
getDragText: function() { var count = this.dragData.records.length;
return Ext.String.format(this.dragText, count, count == 1 ? '' : 's', count > 1 ? 'es' : '');
}
});


Please update String.format arguments as required

avante
Feb 22, 2013, 11:16 AM
I'm sorry for post in wrong forum branch.

Your suggestion solved my problem.

Thank you very much.