Thanks a lot.
I prefixed the name file with the number of method project like "01-FileName".
I sorted the array by name and when i create a model. I execute a rule deleting the first part of the Name.
That the code updated :
<javascript>
fn: function(response, menu)
{
var nodes = response.json.data,
menuItems = [],
name;
//Rajout pour trier la liste des noeuds en fonction du nom.
nodes.sort(function(a,b){
var nameA = a.name.toLowerCase(), nameB=b.name.toLowerCase();
if (nameA < nameB) //sort string ascending
return -1;
if (nameA > nameB)
return 1;
return 0; //default return value (no sorting)
});
for (var i = 0, il = nodes.length; i < il; i++)
{
node = nodes;
name = $html(node.name);
if (node.title && node.title !== node.name && this.options.useTitle)
{
name += '<span class="title">(' + $html(node.title) + ')</span>';
}
menuItems.push(
{
text: '<span title="' + $html(node.description) + '">' + name +'</span>',
value: node
});
}
if (menuItems.length == 0)
{
menuItems.push(this.msg("label.empty"));
}
templateNodesMenu.clearContent();
templateNodesMenu.addItems(menuItems);
templateNodesMenu.render();
},
</javascript>