TrimPath.processDOMTemplate的用法

<div class="boxContent" id="divBoxContent" style="height:auto;"></div>

 

function myTodo(){
	 var params =  $.param({},true);
	 $.post('piEntity!findMyTodoTasks.action', params, function(d){ 
		 var result = TrimPath.processDOMTemplate("myTaskTodo", {list:d.data});
		 var myTaskTodovar = d;
         $('#divBoxContent').html(result);
	  });	
}


 

function openTask(id,entity){
	var piTasksTodoManage;
	if(entity == "com.sinba.sams.complain.entity.PropertyCoordination"){
		piTasksTodoManage = new complaint.applicationForm('','','');
	}
	if(entity == "com.sinba.sams.complain.entity.ComplainManage"){
		piTasksTodoManage = new complaint.inputNewComplaints('','');
	}
	if(entity == "com.sinba.sams.crm.entity.MaintainPlan"){
		piTasksTodoManage = new crm.stakeholderMaintainPlan('','','');
	}
	if(entity == "com.sinba.sams.renewal.entity.Renewal"){
		piTasksTodoManage = new renewal.addContractRenewal('','',1);
	}
	if(entity == "com.sinba.sams.plan.entity.WorkOrder"){
		piTasksTodoManage = new plan.pendingWorkOrders('','');
	}
	piTasksTodoManage.openEditById(id);

}


 

<div id="templateDiv2" style="visibility:hidden">
		<textarea id="myTaskTodo">
	        <table id="tabdaiban" border="0" cellpadding="0" cellspacing="1" width="100%" class="turnList">
                <tr>
                    <th width="60px">动作</th>
                    <th width="120px">距限办时限</th>
                    <th width="160px">工单类型</th>
                    <th>任务标题</th>
                    <th width="70px">紧急程度</th>
                    <th width="100px">处理人</th>
                </tr>
                <tbody id="daibantbody"> 
               	{for i in list }
					<tr>
					
                    	<td width="60px" align="center" onclick="openTask(\${i.entityId} , '\${i.entityClass}')"><a><span>\${i.taskName}</span></a></td>
                     	<td width="120px" align="center" onclick="openTask(\${i.entityId} , '\${i.entityClass}')"><a><span>\${i.duedate}</span></a></td>
                     	<td width="160x" align="center" onclick="openTask(\${i.entityId} , '\${i.entityClass}')"><a><span>
                     		{if i.entityClass == "com.sinba.sams.plan.entity.WorkOrder"}站点规划{/if}
                     		{if i.entityClass == "com.sinba.sams.complain.entity.PropertyCoordination"}物业协调{/if}
                     		{if i.entityClass == "com.sinba.sams.complain.entity.ComplainManage"}投诉处理{/if}
                     		{if i.entityClass == "com.sinba.sams.crm.entity.MaintainPlan"}客户主动维系{/if}
                     		{if i.entityClass == "com.sinba.sams.renewal.entity.Renewal"}合同续签{/if}
                     	</span></a></td>
                        <td width="70x" align="center" onclick="openTask(\${i.entityId} , '\${i.entityClass}')"><a><span>\${i.piTitle}</span></a></td>
                        <td width="70px" align="center" onclick="openTask(\${i.entityId} , '\${i.entityClass}')"><a><span>\${i.urgentStatus}</span></a></td>
                        <td width="100px" align="center" onclick="openTask(\${i.entityId} , '\${i.entityClass}')"><a><span>\${i.assignee}</span></a></td>
            		</tr>
        		{/for}
                </tbody>                                     
            </table> 
		</textarea>
	</div>


 

 

你可能感兴趣的:(function,list,table,Class,div,border)