asp.net mvc 4 - How can I render different div on the basis of a list object that is passed to the partial view from the main view? -
i stuck in situation not able render multiple div's on basis of list of object. below code have written:
main view
<div class="section-wrap break " id="serviceplan_prioritysection" data-bind="foreach:applicationview.viewmodel.listmembers()"> @{html.renderpartial("~/views/home/serviceplan/_priority1.cshtml");} </div>
partial view
<div class="priority-timeline"> <div class="timeline-list"> <div class="timeline-list-items" style="margin-left: 75px"> <h6 data-bind="text:hasvalue(title())?title():' '"></h6> <div class="timeline-bar" id="resizable" data-bind="foreach:applicationview.viewmodel.listmembers()[0].upcomingactivities()"> <div class="priority-icon"> @*<img src="service-plan/image/img_1.png" alt="">*@ <div class="detail-popup"> <strong data-bind="text:hasvalue(title())?title():' '"></strong> <p data-bind="text:hasvalue(description())?description():' '"> </p> </div> </div> </div> </div> </div>
now under main view, list object applicationview.viewmodel.listofmembers() contains 3 values , because of partial view rendered 3 times working fine. however, each 3 values contains multiple values inside it. i.e. object applicationview.viewmodel.listmembers()[0].upcomingactivities() contains 3 values , on. on basis of these 3 values of mainmembers(), render 3 div's under partial view , want use current values of selected upcomingactivities. if using partial view code listed above, getting same value divs rendered using value under foreach foreach:cebmapsapp.cebmapsviewmodel.viewmodel.cebsupportedpriorities()[0].upcomingactivities() i.e 0th value.
how can use current selected values of upcomingactivities of cebpriorities can render divs under partial view , simultaneously use current value inside div.
thanks,
Comments
Post a Comment