Giter Club home page Giter Club logo

Comments (11)

SitePenChrisBarrett avatar SitePenChrisBarrett commented on September 23, 2024

@EToreo Please check out the dijit_layout tests in the test directory. Also, can you provide a test to illustrate this problem that will be able to run stand-alone?
Thanks!

from dgrid.

EToreo avatar EToreo commented on September 23, 2024

Chris,

Here is my code that gives the funny drawing. I don't have time at the moment to create a full test case.

This code takes place in an inherited from BorderContainer's postscript function:

        var pBaseCp = new BaseCp({   // Content pane
            region:              "center",
            style:               "height:40%; width:100%",
            splitter:            "false",
         });

         this.mInstantiatedAttributesGrid = new Grid({   //dgrid
            mLayout:             this,
            mInstantiatedClass:  this.mInstantiatedClass
         }, pBaseCp.domNode);

         this.addChild(pBaseCp);

         this.mStackContainer = new sddm.tabstrip.InstantiatedAttributes({
            region:     "bottom",
            style:      "height:60%; width:100%",
            splitter:   "false"
         });
         this.addChild(this.mStackContainer);

         this.mInstantiatedAttributesGrid.startup();
         this.mStackContainer.startup();

from dgrid.

neonstalwart avatar neonstalwart commented on September 23, 2024

This code takes place in an inherited from BorderContainer's postscript function

@EToreo do you really mean postscript or do you mean postCreate? you should be doing it in postCreate

from dgrid.

neonstalwart avatar neonstalwart commented on September 23, 2024

you also don't need to explicitly call startup for widgets added via addChild. their startup will be called at an appropriate time based on when startup is called for the parent. whenever you can get a chance to make a complete test case it would help - there are many nuances that might not be the same without a complete test case.

from dgrid.

EToreo avatar EToreo commented on September 23, 2024

Well, making these changes didn't help. I will try to make a test case tomorrow for you. Thanks for the advice.

from dgrid.

EToreo avatar EToreo commented on September 23, 2024

Neon and Chris,
I have not yet been able to reproduce this in a stand alone test case. I will keep trying. I can tell you though, that the normal enhanced grid was working in the exact same spot in the GUI and when replaced with the dgrid, it gives this visual output:

![Broken dgrid](http://tinypic.com/r/346nl90/5

As you can see, the dgrid header is offset down and the dgrid body is offset to the right (and maybe down).

from dgrid.

EToreo avatar EToreo commented on September 23, 2024

Well, I have a working test case, but its kinda involved... But if you nest the Dgrid in a bunch of cascading Boarder Containers and Tab Containers (and Content Panes), each time the Dgrid's body gets more and more offset from the header.

Is this enough, or would you like me to find a way to get you a full test case?

from dgrid.

neonstalwart avatar neonstalwart commented on September 23, 2024

can you make a jsfiddle that shows this or provide the code in a gist?

from dgrid.

EToreo avatar EToreo commented on September 23, 2024

@neonstalwart In the coarse of cleaning up my test case for a posting on gist, I managed to fix my problem. I think it was a combination of using the DijitRegistry plugin and setting the content of my wrapping content pane instead of using "appendNode". Seems like using "myConetentPane.domNode.appendNode(myDgrid.domNode)" should work just as well as setting the content of the wrapping content pane, but I will leave that up you you guys.

However, I did run into a different (maybe related bug) seen in this gist: https://gist.github.com/2029242

I will let you take a look (there is a comment marking where the error will occur) and decide if you would like to open a new defect or not - I think one could argue that the bug in the gist I just linked is not a bug because of the lackluster dijit support of dgrid.

Thanks everyone for your help on this issue. Its always nice to have patient people like yourselves to work with.

from dgrid.

EToreo avatar EToreo commented on September 23, 2024

I feel silly. "myConetentPane.domNode.appendNode(myDgrid.domNode)" does work. I meant to say that passing the dom node that I wish to attach to dgrid to as the 2nd argument to the dgrid constructor does not work. Seems like it should, as every other gadget seems to work as such.

from dgrid.

 avatar commented on September 23, 2024

You're explicitly attempting to pass the domNode of another widget as the node that the grid will replace with its own DOM. I wouldn't expect this to work with any dijit widget, either.

What you can do is either pre-render a child node within the ContentPane and have the grid replace that, or do what e.g. the dijit_layout_programmatic test does and actually set the grid as the ContentPane's content, taking advantage of the fact that ContentPane will accept content that looks like a widget object.

Given that this thread has evolved a bit, I'm closing it, with the suggestion that any new questions deserve a new thread. If I've failed to answer your most recent question here though, let me know.

from dgrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.