-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Greetings ZK Community,
I disabled a Button in one of my Project Screen, visible="@load(vm.access)" access is boolean variable and it works. If I inspect Screen via Browser then it looks like this
<td id="k1CP46-chdex" style="display:none;height:100%">
<a id="k1CP46" class="actionbtn fa fa-undo z-a" style="display:none;" title="Cancel" ></a>
</td>
If I modify it like this,
<td id="k1CP46-chdex" style="height:100%">
<a id="k1CP46" class="actionbtn fa fa-undo z-a" style="height:100%" title="Cancel" ></a>
</td>
(Also, href="javascript:; is there after title in above snippet.(Wrote here as Question is spam if I add there) )
Then Hidden Button is VISIBLE and Also that Works. Is this normal behavior?!
Scenario: I am disabling access for "Back" button- if access boolean is false, So User won't see previous List Page. But if User change from Browser Inspect, User is able to see previous List Page by Clicking on "Back" button.
Pretty normal in all html.
The thing is that you need to work with the if
attribute, but that's not dynamic.
In code this looks like appending and removing the item from your page, in stead of just changing the visibility.
But there is also good news.
HTML has now a shadow dom what's the solution of your problem.
ZK works also with the shadow dom from version 8, but your browser need to be compatible with the shadow dom.
With zk 8.0 you can do the following :
<if test="@load(vm.someBoolean)">
...
</if>
The if component will work with the shadow dom, and it's dynamic.
Greetz chill.
Asked: 2018-01-09 20:17:11 +0800
Seen: 16 times
Last updated: Jan 10 '18