Rally Software

 View Only
  • 1.  Why Does my ItemId Specification not Yield the ItemId in DOM?

    Posted Sep 19, 2017 06:07 PM
      |   view attached

    I hope this community will continue to have patience with all of my newbie inquiries.

     

    So I have this itemId specified, 'startDate':

    ItemId Spec in JS

     

    Visually, the layout, though cosmetically crude/simple, unfolds somewhat according to plan.  

     

    Layout with item selected

     

    In the generated markup, it says the id is "datefield-1015-inputEl".  There is no separate itemId.

     

     

    Generated Markup

     

     

    My actual objective is to programmatically change the state of a field when another field is changed.  So, I'm trying to isolate the field.  If there's an idiomatic way of doing that that's better than my path, please, point me in the right direction.

     

    Also, the document object is null.  So, even if the markup specified the ItemId, I could not use getElementById() to find it since the document is null.  


    In the meantime, I'll be trying to understand the basic environment I'm working in better.

     

    Thank you, in advance.

     

    Mike

    Attachment(s)

    zip
    App.js.zip   1 KB 1 version


  • 2.  Re: Why Does my ItemId Specification not Yield the ItemId in DOM?

    Posted Sep 21, 2017 06:19 AM

    miguelfuerte,

     

    These are all based on Sencha ExtJS 4.  There is probably a way to specify this to happen.  I don't know off the top of my head, but will check with some others on this to see if they know.

     

    Michael



  • 3.  Re: Why Does my ItemId Specification not Yield the ItemId in DOM?

    Posted Sep 21, 2017 12:32 PM

    Thanks, Michael!  I think Sean's friend really got me out of the ditch (see replies, below)!  Thank you, for always being so attentive, sir.  Have a great evening over there in Northern Europe.  - MJS



  • 4.  Re: Why Does my ItemId Specification not Yield the ItemId in DOM?
    Best Answer

    Posted Sep 21, 2017 12:23 PM

    miguelfuerte

     

    This is a bit beyond my current skill set with ExtJS but we asked a developer and here is what he said:

     

    The thing with ExtJS is it works very hard to abstract the DOM away from you. So you just need to stay in ext land rather than trying to directly manipulate the underlying DOM. From within an app you should always be able to do this.down('#itemId') to find a component. For example:

    var releaseCombo = this.down('#releaseCombo');this.down('#startDate').setValue(releaseCombo.getRecord().get('ReleaseStartDate'));

    Or if for whatever reason you're this scope is not correct you can always globally look up components:

    Ext.ComponentQuery.query('#startDate')[0]

    Also, the this.app stuff is not necessary as long as you always pass scope: this to all the event listener configs:

    listeners: {     select: this._releaseChanged,     scope: this, }

    And just move that current _releaseChanged function from being a global to just another member within the app class itself.

     

    There's a good example here where a combobox is filtering a grid so you can see the common event handling pattern: https://help.rallydev.com/apps/2.1/doc/#!/example/filterable-grid

     

    Let me know if that helps.

     

    -Sean Davis



  • 5.  Re: Why Does my ItemId Specification not Yield the ItemId in DOM?

    Posted Sep 21, 2017 12:30 PM

    Wow.  Wow. 

     

    This is *great*, Sean.    Thank you, so much, and thanks to the developer who gave the time to give such a thoughtful response!

     

    Many thanks.