Question

Recently, I use the Html5 framework: "phonejs" to develop a mobile project, when I want to make a toolbar menusheet in empty views,

It seems menu text will show up twice in this demo: http://phonejs.devexpress.com/Documentation/ApiReference/Widgets/dxToolbar/Configuration?version=13_2#menuItemRender

I use it like this:

homeToolbarItems = [
    { location: 'menu', text: 'Logout',clickAction:logout },
    { location: 'center', text: 'Subscribe Manage' }
];

and the menu shows 'Logout' twice, what can I do?​

Was it helpful?

Solution

It appears that the menuItemRenderer is triggering twice. Once on initial view and once on click. I was able to remedy this buggy behavior by added a Initialize flag to the first view render. Then if the flag was tripped do not render the menu items again on additional request. Example...

    var menuInit = false;
    var viewModel = {
    menuItemRenderer: function(itemData, itemIndex, itemElement){
        if(menuInit == false){
            itemElement.dxButton({ text: "Execute \"" + itemData.text + "\" action" });
            menuInit = true;
        }
    }}

OTHER TIPS

It seems it's a bug, I just asked the devExpress Phonejs develop team. And it have been solve several days ago.

Here is the question link: http://www.devexpress.com/Support/Center/Question/Details/Q571866

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top