javascript - FuelUX Wizard How to disable specific steps? -
in web form using fuelux wizard (link: http://getfuelux.com/javascript.html#wizard ) , have different roles of people coming page. need able "disable" steps of wizard based on data obtain @ page load. believe have styling of haven't had luck in finding need.
for example,
i have steps 1-6, , user comes page. identify him data architect, need disable steps 4 , 6. have few specific roles need disable combinations of tabs each individual role.
could done calling javascript fuel ux based on role identify user in code behind? , changes need specific step make user not able access it?
edit:
here steps:
<ul class="steps"> <li data-step="1" data-name="documentation" class="active"><span class="badge">1</span>documentation<span class="chevron"></span></li> <li data-step="2" data-name="business"><span class="badge">2</span>business<span class="chevron"></span></li> <li data-step="3" data-name="application"><span class="badge">3</span>application<span class="chevron"></span></li> <li data-step="4" data-name="data"><span class="badge">4</span>data<span class="chevron"></span></li> <li data-step="5" data-name="infrastructure"><span class="badge">5</span>infrastructure<span class="chevron"></span></li> <li data-step="6" data-name="security"><span class="badge">6</span>security<span class="chevron"></span></li> </ul>
my question is, there way disable data-steps code behind?
i've figured out way declaring int arrays in code behind, , accessing them directly under initialize array in javascript. looks this:
code behind:
//check steps disable if (role.contains("data")) { disabledsteps = new int[] {5, 5}; } else if (role.contains("infra")) { disabledsteps = new int[] {4, 5}; } else if (role.contains("security")) { disabledsteps = new int[] { 4, 4 }; }
then, using javascriptserializer declared in code behind, javascript looks like:
var disabledsteps = <%= serializer.serialize(disabledsteps) %>; for(var in disabledsteps){ alert(disabledsteps[i]); $('#mywizard').wizard('removesteps', disabledsteps[i], 1); }
Comments
Post a Comment