0
'항목 추가'라는 이름의 버튼이 있습니다. 목록에서 특정 콘텐츠를 선택하고 '항목 추가'버튼을 클릭하면 facebox를 보여주고 그 페이스 박스에 드롭 다운 목록이 있어야합니다 (특정 조건에 따라 데이터베이스에서 해당 드롭 다운 값이로드됩니다).버튼을 클릭했을 때 페이스 박스를로드하는 방법
여기내 코드입니다 inadvance Pls는보기에 .. ,,, 저를 이렇게 을 감사하는 데 도움 :
이<input type="button" id="add_folder" value="Add Item" rel="facebox" style="display:block; float:left;"/> //for the button 'Add Item'
<input type="hidden" name="nodeval" id="nodeval" value="" />
// 선택한 콜렉션의 코드를 얻으려면
$('#tree1').tree({selectable: true});
$('#tree1').bind('tree.click',
function(event) {
$('#nodeval').val(event.node.id);$('#nodepval').val(event.node.parent.id);
}
);
// 추가
컨트롤러에서$('#add_folder').click(function(){
nval = $('#nodeval').val();
if(nval){
$.get('http://localhost/xxxx/add_items',{ nodval:nval},function(data) {
if(data == 0){
alert('Cannot Add Items');
}else{
alert(data);
}
});
}else{alert('Please select any item to add.');}
});
,,
function add_items()
{
$this->layout = 'ajax';
$nodval = trim($_REQUEST['nodval']);
if($nodval)
{
here i loaded some values from database based on certain conditions .and that is set to a variable 'users'
}else{
echo "0";
}
}
나는 미국, 인도, 스리랑카와 같은 컬렉션을 의미합니다. 인도를 선택하고 "항목 추가"를 클릭하면, facebox에 드롭 다운 목록이 있어야하며, 드롭 다운 목록의 내용은 인도의 일부 상태 일 수 있습니다. 상태는 데이터베이스에서로드됩니다. – user1581029