This is a migrated thread and some comments may be shown as answers.

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

6 Answers 34 Views
SideDrawer
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 10 Jan 2016, 04:39 PM

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??

 

6 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 14 Jan 2016, 07:01 AM
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
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 14 Jan 2016, 02:34 PM

Will do thanks!

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

0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 14 Jan 2016, 08:32 PM

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.

 

0
Nick
Telerik team
answered on 15 Jan 2016, 11:10 AM
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
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 15 Jan 2016, 04:15 PM

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?

 

0
Nick
Telerik team
answered on 19 Jan 2016, 07:13 AM
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
Tags
SideDrawer
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Nick
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or