Bindings don't seem to be updating content in the drawer

7 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 10 Jan Link to this post

    Simple Sample: https://www.dropbox.com/s/oa3ffhhsgnlej5k/UIBinding.zip?dl=0

     Basically I want to have the items in my drawer be selectable, so when clicked, change the state... but the items don't seem to update, am I doing this wrong??

     

  2. Nick
    Admin
    Nick avatar
    593 posts

    Posted 14 Jan Link to this post

    Hello Steve,

    Yesterday we released a version that addresses the problem. Can you try it out with it? 

    Regards,
    Nick
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 14 Jan in reply to Nick Link to this post

    Will do thanks!

    Hey, is there no release notes for the version updates anywhere to look at?

  4. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 14 Jan Link to this post

    Nothing seems to be happening for me... 

    <Label row="0" col="0" text=""  class="{{ isSelected ? 'drawericon selected materialdesign' : 'drawericon materialdesign' }}" />

    Doesn't matter how I change the bool, the UI doesn't update

    exports.onSelectTopic = function(args){
        var stack = args.object;
        var item = stack.bindingContext;
         
        item.isSelected = true;
        viewModel.topics.getItem(0).isSelected = true;

    If I remove the css binding and just make it class="drawericon selected materialdesign" I see the fonticons color change, so I know there is a "selected" definition set in the CSS that works.

     Also if I edit the code before binding such that isSelected is true for everything the UI also reflects that based on the css set.

     

  5. Nick
    Admin
    Nick avatar
    593 posts

    Posted 15 Jan Link to this post

    Hello Steve,

    In order for the UI to receive notifications about the change in the bound properties, you need to use the set("propertyName", value) and get("propertyName") methods in the observable class. 

    Hope this helps. 

    Regards,
    Nick
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 15 Jan in reply to Nick Link to this post

    So "topics" is an observable array... the items bound in the sidedrawer are items in that array 

    topics: new observableArray.ObservableArray(),

    So I do see that "setItem" is an option, and seems to work, so is that then what I need to do?  Loop though the items in the obsArray, find the item I want and replace it, or is there an easier way to know the index of a clicked item though it's binding context or something?

     

  7. Nick
    Admin
    Nick avatar
    593 posts

    Posted 19 Jan Link to this post

    Hello Steve,

    The control placed insidethe SideDrawer's contents will handle the observable array changes only if it supports observable arrays. In any other case you have to manually update it to replicate the changes in the UI. The approach you found is a valid one, so you can use it. 

    As to the index of the clicked item, again, it depends on what the container for that item is, and if it supports indexation of its children.

    Hope this makes sense. 

    Regards,
    Nick
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top