0

How do I check for an empty grid?

asked 2011-12-09 16:18:32 +0800

jwolfsho gravatar image jwolfsho
57

I am using gridComments below and I need to reset this grid when a new employee selection is made:

 <window id="empComment">
                    <groupbox id="gbComments" mold="3d">
                        <!--<style src="/widgets/layout/group_box/sprite.css.dsp" />-->
                        <!--<attribute name="onOpen"><![CDATA[arrow.setSclass("open-" + self.isOpen());]]></attribute>-->
                        <caption label="Comments">
                            <button id="commentAdd" label="+"/>
                        </caption>
                         <grid id="gridComments" sclass="myStyle">
                             <columns>
                                <column id="pwricmt_comment" label="Comment"/>
                                <column id="pwricmt_activity_date" label="Date/Time" />
                                <column id="pwricmt_user_id" label="User ID"/>

                             </columns>
                             <rows id="gridRows">
                                <row>

                                </row>
                             </rows>
                            </grid>
                    </groupbox>
                </window>

I am trying to use the following code to reset the grid, however this will not work when the grid is null, so I must check for an empty grid before I try to reset it:

 empComments_gridComments.getChildren().clear()

Thanks for any help!

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2011-12-09 16:25:24 +0800

zippy gravatar image zippy
504 1 2

gridRows.getChildren.clear();

you only need clean the rows

link publish delete flag offensive edit

answered 2011-12-09 16:36:12 +0800

jwolfsho gravatar image jwolfsho
57

Zippy,

I have my rows defined as empComment_gridRows. What would the syntax for the "clean" be? I'm not finding a "clean" in the intellisense list.

Thanks for your help.

link publish delete flag offensive edit

answered 2011-12-09 16:53:23 +0800

jwolfsho gravatar image jwolfsho
57

Zippy,
It's working now with empComment_gridRows.getChildren().clear()


Thanks so much for your help !!!

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-12-09 16:18:32 +0800

Seen: 140 times

Last updated: Dec 09 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More