Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Issues in using "Menu" as a select list.

    Hello Isomorphic,

    I am trying to create a "multiple selectable Menu" in my application.
    I am facing few issues with it.
    1) As many times i open menu with menu button the data source field keep on appending to menu list. Where as it should be only single set of values (see attached image)
    2) I keep seeing "Empty Submenu" selection. I want to just set it at level 1 and not multi level submenu.
    3) Also i can see attributes like shadowDepth, and showShadow in example but not available in documentation?

    Any pointers?

    Menu / Menu button definitions
    Code:
    isc.Menu.create({
        ID: "cooponSelectDropDownMenu",
        autoDraw: false,
        showShadow: true,
        //shadowDepth: 10,
    	dataSource:"couponTypeDS",
    	selectionType: "multiple",
    	showSubmenus : false,
    	itemClick:function(item){
    		//alert('Item cliecked');
    		item.checked =  true;
    	},
    	cellClick: function(record, rowNum, colNum) {
    		//alert('Cell  cliecked');
    		if (record.checked) {
    			record.checked = false;
    		}
    		else {
    			record.checked = true;
    		}
    	}
    });
    
    isc.MenuButton.create({
        ID: "cooponSelectMenuButton",
        title: "File",
        width: 100,
        menu: cooponSelectDropDownMenu
    });

    #2
    We would recommend upgrading to 8.0, where this is a built-in feature.

    Comment


      #3
      Originally posted by Isomorphic
      We would recommend upgrading to 8.0, where this is a built-in feature.
      Ok. but still this is an issue with Menu? right? That as many times i open the menu the list of items in it keep on adding to it? Any solution for this?

      Thanks

      Comment


        #4
        Or with your DataSource, it's unclear. You can always call DataSource.fetchData() directly and create MenuItems from the returned Records instead.

        Comment


          #5
          Originally posted by Isomorphic
          Or with your DataSource, it's unclear. You can always call DataSource.fetchData() directly and create MenuItems from the returned Records instead.
          Any code example how can i create MenuItems array from that data?
          So documentation says about creating it as object literals?
          So i will need to populate the menu with say value "United Kingdom" as menu title and a code say "UK" as hidden value for this selection?

          So how can I do it? Any pointer to code snippet will be helpfull.

          Thanks

          Comment


            #6
            Read the docs for DataSource.fetchData(), it covers this use case (creating components from DataSource results).

            Comment


              #7
              I am sorry but I am not able to get much still how to create an Array of "MenuItems" from data.

              So I have got the data in my js using dataSource.fetchData. Now I create an array of display values and set it on menu.

              I need to create a "MenuItem" from the data to display in menu.

              Thanks

              Comment


                #8
                Found the solution and to way to create Menu Item object . thanks for all help.

                Comment

                Working...
                X