v89: expand sub-items as separate rows with own Open button
This commit is contained in:
parent
a951bb74d8
commit
b798cc90a7
13
index.html
13
index.html
@ -342,18 +342,17 @@ function renderEv(){
|
||||
h+="<td><button class='btn btn-sm' style='padding:4px 12px;font-size:11px' onclick='openEv("+e.id+")'>Открыть</button></td>";
|
||||
h+="</tr>";
|
||||
if(e.sub&&e.sub.length>0){
|
||||
h+="<tr class='"+rowCl+"'><td colspan='7' style='padding:2px 10px 4px;border:none'><div class='sub-row' onclick='togSub("+e.id+")'>";
|
||||
var ss=localStorage.getItem("ss_"+e.id);
|
||||
var sc=0;
|
||||
if(ss){try{var sp=JSON.parse(ss);for(var si=0;si<sp.length;si++){if(sp[si])sc++}}catch(ex){}}
|
||||
h+="<span class='arr' id='arr_"+e.id+"'>▸</span> Подпункты ("+e.sub.length+", исп. "+sc+")</div>";
|
||||
h+="<div id='sub_"+e.id+"' class='sub-items' style='display:none'>";
|
||||
for(var si=0;si<e.sub.length;si++){
|
||||
var checked="";
|
||||
if(ss){try{var sp=JSON.parse(ss);if(sp[si])checked="checked"}catch(ex){}}
|
||||
h+="<div class='sub-item'><input type='checkbox' "+checked+" onchange='chkSub("+e.id+","+si+",this.checked)'> <span>"+esc(e.sub[si].l)+") "+esc(e.sub[si].t)+"</span></div>"
|
||||
h+="<tr class='"+rowCl+" sub-item-row'><td style='padding-left:24px;font-size:11px;color:#64748B'>"+e.id+"."+esc(e.sub[si].l)+"</td>";
|
||||
h+="<td style='font-size:11px'>"+esc(e.sub[si].t)+"</td>";
|
||||
h+="<td style='font-size:11px'>"+esc(nl2c(e.r))+"</td>";
|
||||
h+="<td style='font-size:11px'>"+e.due+"</td>";
|
||||
h+="<td><input type='checkbox' "+checked+" onchange='chkSub("+e.id+","+si+",this.checked)'> <span class='badge "+cl+"' style='font-size:10px'>"+stn[e.s]+"</span></td>";
|
||||
h+="<td><button class='btn btn-sm' style='padding:4px 10px;font-size:11px' onclick='openEv("+e.id+")'>Открыть</button></td></tr>"
|
||||
}
|
||||
h+="</div></td></tr>"
|
||||
}
|
||||
}
|
||||
if(!h)h="<p style='color:#64748B;padding:20px;text-align:center'>Нет мероприятий</p>";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user