我想在所有TreeView节点上运行一些代码,取决于从数据库返回的值,并重复此操作,直到返回某个特定的值。
我在想:
- Give all my tree nodes the same css class so I can access them from JQuery
- have a timer in my JQuery function that used ajax to go to the database, when a certain value is returned then stop the timer
Two questions here. How can I make my function run for each of the nodes and how do I do a timer in JavaScript, so:
$(function(){
$( cssClassOfAllMyNodes ).WhatFunctionToCallHere?((){
//How do I do Timer functionality in JavaScript?
ForEachTimeInterval
{
//use Ajax to go to database and retrieve a value
AjaxCallBackFunction(result)
{
if (result = 1)
//How to stop the timer here?
}
}
Sorry, but there is no text to translate. Please provide the text that needs to be translated into Chinese.
Sorry, but there is no text to translate. Please provide the text that needs to be translated into Chinese.
希望我说得清楚。非常感谢。
非常感谢您的回答。我想请您对设计进行评论。
基本上我要实现的是Windows Workflow类型的功能,在我的树形结构中,每个节点根据其状态更新其图像,其状态是通过查询数据库得到的,该数据库具有与树节点唯一关键字。如果您有任何其他实现方式的想法,我很乐意听取您的建议。再次感谢。