Search Support
-
Martin LorenzMarch 22, 2017 at 6:48 am #4052
Hello,
I have a problem. I would like to ask, how I can setIcon in Icon control, which is in table row? For example, I have a method, which I call in load event in table:
this.setIcon = function(){ var data = this.context.binding.get("value").get("dataList"); for(var i = 0; i < data.items.length; ++i){ if(data.items[i].isTrue){ //setIcon('check') } else{ //setIcon('times') } } }
but I don’t know, how I can refer to specific element Icon control. Please help.
SPARK SupportMarch 22, 2017 at 2:40 pm #4056Hi Martin,
You should be able to access the control with the index location:
ico1 = page.ui.get(“/Table2/Icon1[0]”);
Even after a row is deleted, i should match the position of the row.
Regards,
Stephen P.
Martin LorenzMarch 23, 2017 at 2:39 pm #4059Hello Stephen
Thank you very much for help. Everything works 🙂 but I have one more question. Can I get to icon in the table, using relative path? Becouse in example, which I gave I do:
ico1 = page.ui.get(“/coache_view_id/table_id/icon_id[0]”)
and this work. But when I put my coache view in another coache view, stops working. Then I have to change the path in my code with:
ico1 = page.ui.get(“/coache_view_id/table_id/icon_id[0]”)
to
ico1 = page.ui.get(“/coache_view_id_1/coache_view_id/table_id/icon_id[0]”)
SPARK SupportMarch 23, 2017 at 3:58 pm #4060Hi Martin,
In that case, I would add a function to your Coach View such as this.setIcon = funcion(index) {} with the absolute path inside the coach. Then call the outerCoach.setIcon(index) from the higher level. Either way, you will have to code something to make the connection.
Regards,
Stephen P.
-
|
You must be logged in to reply to this topic.