Announcement

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

    #16
    You can't just specify some random hardcoded position. Look up the position of the member you want to be after, and addMember() after that.

    Bear in mind, members may be created lazily. After draw() is probably the best place to add your additional members.

    Comment


      #17
      Can you point us to one example code where it is done or any specification which states the details for the same.
      It will help a lot!
      Thanks!

      Comment


        #18
        If your window class is derived from isc.Window, you should call addItem() instead of addMember(). Window itself is a layout and has default members such as header, body, footer. Thus if you call addMember, your controls get added among such top-level members, which breaks window layout, and you probably don't want this.

        Comment


          #19
          Thanks a lottttttttttttttttttttt marpetr!

          You solved the mystery for us..!

          I am adding the finally working code here so that others can benefit from this.!!!


          isc.defineClass("MyWindowClass","Window");

          isc.MyWindowClass.addProperties({
          title: "My Window",
          width:440,
          height:260,
          autoCenter: true,
          isModal: true,
          showModalMask: true,
          saveBtnDefaults: {
          _constructor: isc.IButton,
          title: "Save"
          },
          discardBtnDefaults: {
          _constructor: isc.IButton,
          title: "Discard"
          },

          initWidget: function() {
          this.Super("initWidget", arguments);
          this.addItem(this.createAutoChild("saveBtn"),0);
          this.addItem(this.createAutoChild("discardBtn"),1);

          }

          });

          function openMyWindow () {
          isc.MyWindowClass.create({
          ID: "myWindowInstance"
          });

          myWindowInstance.show();
          alert("hi");
          }

          function openMyWindow2 () {
          isc.MyWindowClass.create({
          ID: "myWindowInstance2"
          });

          myWindowInstance2.show();
          alert("hi2");
          }

          function closeWindow() {
          myWindowInstance.markForDestroy();
          myWindowInstance.destroy();
          alert("bye");
          }

          function closeWindow2() {
          myWindowInstance2.markForDestroy();
          myWindowInstance2.destroy();
          alert("bye2");
          }

          //create first time
          openMyWindow();
          openMyWindow2();
          //destroy first time
          closeWindow();
          closeWindow2();

          Comment

          Working...
          X