FlexLayout
FlexLayout copied to clipboard
I Can select a tab which in a tabset (programmatically) but can't select a tab which in a border (programmatically)
Hi, i have a left border which has 2 tabs inside it and name is myLeftBorder
i want to select second tab programmatically, i tried below code,
myModel._borders._borders[0]._attributes.selected = 1 // default selected tab is 0.
and also i tried to below code
myModel.doAction(Action.setActiveTabset("myLeftBorder"))
myModel.doAction(Action.selectTab("mySecondTab")
and also i tried to below code
myModel.getBorderSet().getBorders()[0]._setSelected(1)
both of codes doesn't worked.
i can see selected as 1 with below code, i think there is a refresh problem
myModel.getBorderSet().getBorders()[0].getSelected()
What can i do for solve my problem.
Thanks inadvance.
ok. i found a refresh solution (I searched inside the model proto)
below code works well
myModel.getBorderSet().getBorders()[0]._setSelected(1)
myModel.doAction(Actions.Actions.updateModelAttributes(JSON.stringify(myModel.toJSON())))
you can use myModel.doAction(Action.selectTab(idOfSecondTab)) where your second tab has id: idOfSecondTab (it's the id not the name of the tab)
you can use myModel.doAction(Action.selectTab(idOfSecondTab)) where your second tab has id: idOfSecondTab (it's the id not the name of the tab)
i already tried below code but doesn't worked on Border, but working on Tabset well
myModel.doAction(Action.selectTab("mySecondTab")
my sample code which at above answer working well.
how can i select a tab in a tabset programmatically?