uiFactory冲突,重新提交

This commit is contained in:
hmm 2014-08-15 16:54:51 +08:00
parent 0950ae617c
commit 3545cad3fe
1 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,51 @@
function createRadioGroup(items,name,containerId){
for ( var i = 0; i < items.length; i++) {
var radio = createRadio(items[i],name);
$("#" + containerId).append(radio);
}
}
function createRadio (item,name) {
var line = $("<div>");
var input = $("<input type='radio' name="+name+">");
input.attr("value",item);
var span = $("<span>");
span.html(item);
line.append(input);
line.append(span);
line.addClass("line");
return line;
}
function jstreeCreateNode(containerId,name,id,pos){
var ref = $("#"+containerId).jstree(true);
var sel = ref.get_selected();
if(!sel.length){
sel=null;
}
else{
sel = sel[0];
}
sel = ref.create_node(sel,{"text":name,"id":id},pos);
if(sel) {
ref.edit(sel);
}
}
/*
function jstreeDeleteNode(containerId){
var ref = $("#"+containerId).jstree(true);
var sel = ref.get_selected();
if(!sel.length){return false;}
ref.delete_node(sel);
//return sel.
}*/
function jstreeCreate(containerId){
$("#"+containerId).jstree({
"core" : {
"animation" : 0,
"check_callback" : true,
"themes" : { "stripes" : true }
}
})
}