Pagelist idByIndex Method

According to my javascript console, my pagelist object does not have the method idByIndex.

var i = 0; for (i=0;i<$$("wot").dataCount();i++){ var id = $$("wot").idbyindex(i); alert(id); }

The preceding code throws an error. Why?


I addition, I should also mention the difficultly I am having placing multiple items inside of a scrollview.

I have the following:

{ view: "scrollview", scroll: 'y', content:{rows:[ { view: "label", id: "lbl", height:'auto', label: "What's on tonight?" }, { view: "pagelist", id: "wot", panel: false, type: {height: "100%", width: imageWidth}, scroll:'x', data: hdata, datatype: "json", template: "<div style='height:auto; width:" + imageWidth + "'><img src='http://url/#ImagePath#' width=" + imageWidth + " height='auto' onerror='imageLoadFailure(this)'/><div style='text-align: center;'>#Title#</div></div>" }, { view: "list", id: "navigator", datatype: "json", data: buttonList, template: "<div style='background-image: url(http://url.png); background-repeat:no-repeat; background-position: right center;'>#name#</div>" } ]} }

And it refuses to scroll. Why?


The preceding code throws an error. Why?

Please check method name. The correct is idByIndex and you use idbyindex

And it refuses to scroll. Why?

this issue will be solved in the next version. Let me know if you need to get dev version ASAP.

Thank you very much Alexandra. Whether I need the dev version or not is dependant on the full version release, when you you forsee it being released? I’d love to get this working but can wait if a stable release is not very far away.

Sorry for the misleading information. The scrollview in the latest Touch package can be scrolled in the content view is also scrollable. However, make sure that the height of the content is desired:



Thank you so much, that worked perfectly.

One more question regarding scrollviews, or views in general. The reason I was having these problems was because I was putting ‘auto’ in for the height parameter of the scrollview for the longest time. Since the height of all the devices using my application will be different, how can I put in an accurate height for the scrollview so that all encompassed controls are viewable by scrolling, but you cannot “overscroll”, or scroll so far that items go out of view?

All of your help has been greatly appreciated!

Okay so now I see that in order to use scrolling over content with variable length, I need to use ‘template’ rather than scrollview. My question now, is can I use dhx ui controls inside the template of a template view? If so how?

I’ve seen it point to html, ie.


but how can I make the template point to a group of other DHTMLX controls? Ie, a layout full of content.

It is possible to place form controls (buttons, inputs, etc. ) into template of multidata component.

Please see the sample:

Layout can not places into template.

Using activeTemplate seems to work with the exception that nothing shows up on the screen.

The source tells me that the controls are present, but I cannot see or interact with them.

Have you ever encountered this problem before?

I figured out the answer to my previous question, however this solution will not be sufficient. It is unfortunate that there is no way to automatically detect the height of scrollview content, because when I place a value in for the content height, it differs the result drastically on different devices.

If on an iPad my device scrolls to the perfect length, on my playbook it will not scroll at all, due to differing resolutions.

I hope in the future support will arrive for this issue.

You can set fixed size for the scrollview content.

height: 500,


The problem is that depending on the screen I’m on or the resolution of the screen in question, the height of the scrollview will be different. Unfortunately the scrollviews do not default to the height of their entire content like lists do, otherwise it would work perfectly.

On an iPad, my scrollview content height may be 1000 whereas on the BlackBerry Playbook it exceeds 1300. This requires skinning individually for every device, which can be quite time consuming as we must consider every Phone/Tablet/Computer that may try access the site.

Instead of setting height to the content object of scrollview - you can set content to the child elements, and try to use height:“auto” for elements which are dynamic ( list, template, etc )

{ view: "scrollview", scroll: 'y', content:{rows:[ { view: "label", id: "lbl", height:'auto', label: "What's on tonight?" }, { view: "pagelist", id: "wot", panel: false, type: {height: "100%", width: imageWidth}, scroll:'x', data: hdata, datatype: "json", template: "<div style='height:auto; width:" + imageWidth + "'><img width=" + imageWidth + " height='auto' /><div style='text-align: center;'>#Title#</div></div>" }, { view: "list", scroll:false, id: "navigator", height:"auto", datatype: "json", data: buttonList, template: "<div>#name#</div>" } ]} }

Above code is taken from your original example - it renders list in the scrollview, and scrollview inner height will always be adjusted to the list length.

Thank you very much Stanislav and Alexandra, I appreciate all your help.

It turns out the problem was not DHTMLX related, but rather was an incorrect meta tag, specifying he screen height incorrectly.

Thank you for taking the time to assist me. Everything is working very well and near completion.