0
我正在使用jstree並試圖捕獲複選框狀態更改事件。我如何獲取當前選中的複選框的狀態和其列表ID?如何捕獲複選框點擊事件?
我在這裏找到的例子: Jquery Jstree checkbox events capture 工作,但我無法弄清楚如何獲得節點的檢查狀態。如果有更好或更簡單的方法,我願意接受其他建議。
$("#demo1").bind("change_state.jstree", function (e, d) {
if ((d.args[0].tagName == "A" || d.args[0].tagName == "INS") &&
(d.inst.data.core.refreshing != true && d.inst.data.core.refreshing != "undefined"))
{
//if a checkbox or it's text was clicked,
//and this is not due to a refresh or initial load, run this code . . .
alert("list id: " +d.rslt.attr("id"));
alert("is item checked?" +"***TODO***");
}
});
謝謝。
**編輯:我讓我的問題更清楚,以避免任何關於組合插件的混淆(這不是我正在做的)。我在jstree中啓用了樹形複選框。 **
您是否找到了解決方案?我面臨同樣的問題。 plz幫助。 – Shibankar