Я использую динамическое значение для initial_select & open, которое checked_id. в checked_id, я присвоил значение '"skillTree_1576","skillTree_1573"'
но его не работает... если одно и то же значение проходит статически, то его рабочий тон.... следующий - это исходный код
$("#"+node_id+"Edit").live("click", function(){
$('#'+node_id+'Lookup').show();
$('#'+node_id+'Values').hide();
$("#"+node_id).bind("check_node.jstree", function (e, data) {//check all parent nodes
var currentNode = data.rslt.obj.attr("id");
var parentNode = data.rslt.obj.attr("parent_id");
$("#"+node_id).jstree("check_node", "#"+parentNode);
}).bind("uncheck_node.jstree", function (e, data) {//uncheck all child nodes
var currentNode = data.rslt.obj.attr("id");
var allChildNodes = data.inst._get_children(data.rslt.obj);
allChildNodes.each(function(idx, listItem) {
var nid = $(listItem).attr("id");
$("#"+node_id).jstree("uncheck_node", "#" + nid);
});
}).jstree({"0":"","plugins":["themes","json_data","ui","search","hotkeys","checkbox"],"checkbox":{
"real_checkboxes":true,"two_state":true,"checked_parent_open":true,"override_ui":true
},"themes":{"theme":"classic","dots":true,"icons":false},"json_data":{
"ajax":{"url":baseUrl+url,"data":function (n) {
return {'node_name': node_id, 'operation' : 'lookup_children', 'id' : n.attr ? n.attr('id').replace(/[a-z0-9A-Z]+_/g,'') : 0 };
$('#'+node_id+'emptySearch').hide(); },"success":function(){}}},"search":{
"show_only_matches":false,"ajax":{
"url":baseUrl+url,"data":function (str) {if(str.length > 2 ) {
return {'node_name': node_id, 'operation' : 'search', 'search_str' : str}; } },"success":function (data) {
if(data.length == 0) { $('#'+node_id+'emptySearch').show();
} else {
$('#'+node_id+'emptySearch').hide();}}}},"ui":{"initially_select":[checked_id] },"core":{
"initially_open":[checked_id],"load_open":true,"open_parents":true}});
// alert ('hello : '+checked_id);
});
если у кого-нибудь есть идея об этом, пожалуйста, помогите мне.. спасибо в Advance
Для выбора нескольких идентификаторов вы можете использовать следующее:
$("input[id^='skillTree_']")....
^
используется для начала с определения строки.