Error while adding items dynamically in a grouplist

Hi,

I was wondering if there’s a way to add new items to a grouplist dynamically because I’ve tried to do it by using ‘add’ method and passing it a mock object:

var obj = Object();
obj.id = id+“1”;
obj.text = “new”;
obj.type = “folder”;
obj.css = “folder_dialing”;

This piece of code gets executed on an item click event:

$$(“menu”).add(obj);

What I should see is a new item in my grouplist, however, I’m getting the following error from (FireFox 3.6.13):

this.order.insertAt is not a function (touchui.js?v=0.5 (line 139)).

Any suggestion to get this fixed?. Could anyone send me an example of how to add a new item into a grouplist dynamically?

Thanks,

Pipe

Hi,

we have reproduced the problem. Please use attached dhtmlx.js instead of the original.
touchui.zip (41.8 KB)

I did what you suggested but it seems not to be working out either, i caught up the following error in Firebug:

b[e] is not a constructor
touchui.js (line 86)

Thanks,

Pipe

Please have a look at the attached demo. Hope it’ll solve the problem.
grouplist.zip (77.4 KB)

Thanks, I’ve fixed the problem already, however, i had to get rid of some important elements from my original structure which i was using to load html files

Previous structure:

var config = {
container:“principal_menu”,
rows:[
{
view:“toolbar”,

},
{
view:“tabbar”,
cells:[
{
view:“grouplist”,

},
{
view:“iframe”, id:“container”
}
]
}
]
}

New structure:

var config = {
container:“principal_menu”,
rows:[
{
view:“toolbar”,

},
{
view:“grouplist”,

}
]
}

I had created an iframe view to load html files after clicking on a leave item at the grouplist. Don’t know why my previous structure collapses with the new version (0.8v), at least at load time.

Thanks,

Pipe

The “tabbar” view has been renamed in the 0.8 version. Please use “multiview” instead of it:

{
view:“multiview”,
cells:[
{
view:“grouplist”,

},

Please read about all changes here:

dhtmlxTouch_08b_110217/migration.txt
dhtmlxTouch_08b_110217/whatsnew.txt