treegrid row height problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ani1586
    New Member
    • Aug 2008
    • 9

    treegrid row height problem

    Hi,

    I want the rows in the treegrid to have the same height, and if there's a cell with a lot of content, to be able to click on that cell or row, and the row height will increase - so that all the cell content is visible.

    By default if the MaxHeight is not set and VarHeight is set to 1, the rows height adjust so that all the cells content is visible, but I want this to happen only after clicking the cell or row.

    Any idea how to do that?

    Thanks in advance.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Post your code or a link. Are you using a third party treegrid?

    Comment

    • ani1586
      New Member
      • Aug 2008
      • 9

      #3
      Hi,

      I've downloaded treegrid zip file from :



      my files:

      the htnl file:

      [HTML]<html>
      <head>
      <script src="../../Grid/GridE.js"> </script>

      </head>
      <body>

      <div style="WIDTH:10 0%;HEIGHT:90%">
      <bdo Layout_Url="myF irstDef.xml" Data_Url="myFir stData.xml"></bdo>
      </div>

      </body>
      </html>
      [/HTML]

      The data file:

      [CODE=xml]<?xml version="1.0"?>
      <Grid>
      <Body>
      <B>
      <I id="c" Def="Node" A="Order 003" C="aaaaaaaa bbbbbbbb ccccccccccc dddddddddd">


      </I>


      </B>
      </Body>
      </Grid>
      [/CODE]

      The layout file:

      [CODE=xml]<?xml version="1.0"?>
      <Grid>
      <Cfg id='First'
      VarHeight="1"


      />

      <Cols>

      <C Name='C' Type="Lines" CanEdit="2" Width="100"/>

      </Cols>


      <Def>

      <D Name="R" MaxHeight="17" />
      </Def>
      <Header
      C="Date"

      />

      </Grid>[/CODE]


      Hope that helps you to help me :)
      Last edited by acoder; Aug 11 '08, 03:26 PM. Reason: Added [code] tags

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Have you been through the tutorials first?

        Comment

        • ani1586
          New Member
          • Aug 2008
          • 9

          #5
          yes I have, and I couldn't find an example, nor documentation of what I need :( though it's seems like basic functionality.. .

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Have a look at the API and see if you can extend it. If not, post your attempt.

            Comment

            • ani1586
              New Member
              • Aug 2008
              • 9

              #7
              I've looked at this API, I only see expand or extend attributes that concrens expanding or collapsing of tree children. If I set the MaxHeight to one line - I don't see how I can expand the row onClick.
              I have an example of a a very simple tree with one column and one row. The column is non editable (CanEdit="2"), MaxHeight=17.

              The html file:

              [HTML]<html>
              <head>
              <script src="../../Grid/GridE.js"> </script>

              </head>
              <body>

              <div style="WIDTH:10 0%;HEIGHT:90%">
              <bdo Layout_Url="myF irstDef.xml" Data_Url="myFir stData.xml"></bdo>
              </div>

              </body>
              </html>
              [/HTML]

              The configuration (layout) file:

              [CODE=xml]<?xml version="1.0"?>
              <Grid>
              <Cfg id='First'
              VarHeight="1"


              />

              <Cols>

              <C Name='C' Type="Lines" CanEdit="2" Width="150"/>

              </Cols>


              <Def>

              <D Name="R" MaxHeight="17"/>
              </Def>
              <Header
              C="Date"

              />

              </Grid>
              [/CODE]
              Data file:

              [CODE=xml]<?xml version="1.0"?>
              <Grid>
              <Body>
              <B>
              <I id="c" C="aaaaaaaa bbbbbbbb ccccccccccc dddddddddd">


              </I>


              </B>
              </Body>
              </Grid>[/CODE]


              It would be great if you could help me with that.
              Last edited by acoder; Aug 12 '08, 10:20 AM. Reason: Added [code] tags

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                What about the UpdateRowHeight () method?

                PS. please use code tags when posting code.

                Comment

                • ani1586
                  New Member
                  • Aug 2008
                  • 9

                  #9
                  I have a temporary problem with my computer and I don't have access to the html I've created, but I added these lines to the head section of it:

                  [HTML] <script type="text/javascript">Gri ds.OnClick = function(grid, row, col, x, y, handled, event) {grid.UpdateRow Height(row);}</script>[/HTML]

                  I see that I catch the event (when I put alert in the function I see it), but the row is not expanded..... :(

                  Comment

                  • ani1586
                    New Member
                    • Aug 2008
                    • 9

                    #10
                    better use of code tags:

                    [HTML]<script type="text/javascript">
                    Grids.OnClick = function(grid, row, col, x, y, handled, event)
                    {
                    grid.UpdateRowH eight(row);
                    }
                    </script>
                    [/HTML]

                    Comment

                    • ani1586
                      New Member
                      • Aug 2008
                      • 9

                      #11
                      This works :)

                      [HTML]<script type="text/javascript">
                      Grids.OnClick = function(grid, row, col, x, y, handled, event)
                      {
                      row.MaxHeight=" 200";
                      grid.RefreshRow (row);
                      }
                      </script>[/HTML]

                      Comment

                      • acoder
                        Recognized Expert MVP
                        • Nov 2006
                        • 16032

                        #12
                        Glad you got it working. Thanks for posting the solution :)

                        Comment

                        • ani1586
                          New Member
                          • Aug 2008
                          • 9

                          #13
                          you welcome :) and thanks for your time.

                          Comment

                          Working...