EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: putusundika on July 01, 2012, 08:24:40 PM



Title: Nested Dialog Form
Post by: putusundika on July 01, 2012, 08:24:40 PM
dear all, please help. I totally newbie with EasyUI but starting to enjoy :)

i follow the example :

Code:
function newData(){
 $('#dlg').dialog('open').dialog('setTitle','New Data');
 $('#fm').form('clear');
 url = 'modul/mod_part/save_data.php';
}

<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newData()">New Data</a>

<div id="dlg" class="easyui-dialog" style="width:650px;height:350px;padding:10px 20px" closed="true" buttons="#dlg-buttons">
 <div class="ftitle">Master Parts</div>
  <form id="fm" method="post" novalidate>
    <div class="fitem" align="left">
        <p><label>Category</label>
         <input name="id_part_cat_part" style="width:100px" class="easyui-combobox"
              url="modul/mod_part/part_cat.php"valueField="id_part_cat" textField="name_part_cat" required="true"> </input>
         </p>

....

I'm using PHP and MySQL, so far its work.

so every time i click Add New button, dialog form will show up with combobox.

Now, my problem is :
if the items is not in list, i want to open another dialog form to add new item to the combobox. So, i need open 2 dialog form whichis nested.
how can i do that ?
or maybe any complete simple example for this ?

sorry for typo and my bad english

regards



Title: Re: Nested Dialog Form
Post by: stworthy on July 02, 2012, 02:23:22 AM
Why to open another dialog form to add new item to the combobox? The combobox data has been loaded via 'modul/mod_part/part_cat.php'.


Title: Re: Nested Dialog Form
Post by: putusundika on July 02, 2012, 06:38:35 AM
thnks for reply n support stworthy

my combo box refer through file modul/mod_part/part_cat.php to table(name_part_cat) which is has 2 fields : id_part_cat and name_part_cat. none of these fields allows to empty (both required).

part_cat.php :
Code:
 $rs = mysql_query("select * FROM part_cat order by name_part_cat ASC");
 $items = array();
 while($row = mysql_fetch_object($rs)){
array_push($items, $row);
 }
echo json_encode($items);

does "The combobox data has been loaded .." means :  i just typing directly new item inside combo box ?

best regards