Announcement

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

    Not able to get tab icon if I add canClose: true (smartclient example code)

    Hi Iso,

    I am not able to get tab icon if I add canClose: true property which is my requirement.

    Below is the smartclient example which is working fine with icons but when I add canClose: true to the any of the tab; icon is not displayed for that tab.

    http://www.smartclient.com/docs/6.5.1/a/system/reference/SmartClient_Explorer.html#tabsOrientation

    Looks like its either close image (right side of title) or icon (left side of title) which tab can display but I need to display both.

    Please provide some workaround if its not possible straight away.

    Thanks in advance,
    Ashish.

    #2
    Known limitation, just add the icon to the title attribute as HTML, eg, using Canvas.imgHTML()
    Last edited by Isomorphic; 11 Mar 2010, 12:08.

    Comment


      #3
      Thanks,
      It worked.

      Comment


        #4
        Hello,

        I run in the same issue. But I have not found the method getImgHTML in the documentation.

        The enclosed code does not show the icon when adding a tab. Could you please provide a piece of code how to add a closable tab dynamically and setting its icon?

        Regards Thomas

        Code:
        isc.TabSet.create({
            ID: "tabSet",
            tabBarPosition: "top",
            width: 400,
            height: 200,
            tabs: [
                {title: "Blue", icon: "pieces/16/pawn_blue.png", 
                 pane: isc.Img.create({autoDraw: false, width: 48, height: 48, src: "pieces/48/pawn_blue.png"})},
                {title: "Green", icon: "pieces/16/pawn_green.png",
                 pane: isc.Img.create({autoDraw: false, width: 48, height: 48, src: "pieces/48/pawn_green.png"})}
            ]
        });
        
        
        isc.IButton.create({
            title: "Add Tab",
            top: 225,
            click: function () {
                // alternate between yellow pawn and green cube
                if (tabSet.tabs.length % 2 == 0) {
                    tabSet.addTab({
                        title: "Yellow",
                        canClose: true,
                        icon: "pieces/16/pawn_yellow.png",
                        pane: isc.Img.create({autoDraw: false, width: 48, height: 48, src: "pieces/48/pawn_yellow.png"})
                    });
                } else {
                    tabSet.addTab({
                        title: "Green",
                        canClose: true,
                        icon: "pieces/16/cube_green.png",
                        pane: isc.Img.create({autoDraw: false, width: 48, height: 48, src: "pieces/48/cube_green.png"})
                    });            
                }
                if (tabSet.tabs.length == 1) tabSet.selectTab(0);
            }
        });
        
        isc.IButton.create({
            title: "Remove Tab",
            top: 225,
            left: 110,
            click: function () {
                tabSet.removeTab(tabSet.tabs.length-1);
            }
        });

        Comment


          #5
          Here's the API, sorry, name was slightly off.

          You want to add it to the title, eg,

          Code:
          title: isc.Canvas.imgHTML(...) + " Blue",

          Comment


            #6
            Hello,

            that was the hint I was looking for. Thank you very much!

            Regards Thomas

            Comment


              #7
              I tested with 4.0-2013-07-16, and this still does not work.
              How about you throw an exception when setIcon () and setCanClose (true) are called?
              Also, if this is not supported, how about removing it?

              Comment

              Working...
              X