Show Posts
|
Pages: [1]
|
4
|
General Category / EasyUI for jQuery / Re: Datagrid column sum
|
on: November 28, 2014, 11:49:00 AM
|
Hi ! Thanks for your interest
J try your code but it does not work maybe j do something wrong
here's my code
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="somma()">Somma</a>
<div class="fitem" > <label>Imponibile:</label> <input id="Imponibile" name="Imponibile" class="easyui-textbox" style="width:80px;height:20px" >
function somma () { $('#tt_dt').datagrid('load') $('#tt_dt').datagrid({ onLoadSuccess:function(data) { var sum = 0; for (i = 0; i < data.length; i++) { sum+=data.Totale_riga; } $('#Imponible').text(sum); } })
} //-------------------------------------------------------------
|
|
|
10
|
General Category / EasyUI for jQuery / load form with a var
|
on: November 14, 2014, 04:34:42 PM
|
Hi ! J was wondering if it is possible to fill a text box in form with the value of another field j mean $('#ff').form('load',{ name:'name2', email:' mymail@gmail.com', subject:'subject2', message:'message2', language:5 }); can j change 'name2', with a var ? j need to fill the field name with the value of another field. J do hope is quite clear.
|
|
|
12
|
General Category / EasyUI for jQuery / Details in a new Winndow
|
on: November 11, 2014, 11:46:01 AM
|
Hi ! J'm new to the Forum and j'm new to jqEasyUI. J 'd like to Know if is possibile to show details in a data grid with a new window.
J have the form Orders and when j click the button details the new window should display the data grid with the related details but j only see the data grid with no records, maybe there must be something wrong with the PHP file it seems not to get the VAR $id.
Thanks for your help.
<!-- Section html datagrid Orders --> <table id="tt" class="easyui-datagrid" style="width:700px;height:450px" url="Order_get_search.php" title="Ordini fornitori" iconCls="icon-search" toolbar="#tb" rownumbers="true" pagination="true" singleSelect="true" fitColumns="true"> <thead> <tr> <th field="Numero" width="120">Numero</th> <th field="Riferimento" width="300">Riferimento</th> <th field="Data" width="300">Data</th> <th field="id" width="300">ID</th> </tr> </thead> </table> <!-- End section -->
<!-- Section html datagrid Orders details -->
<table id="tt_dt"class="easyui-datagrid" title="Dettagli" style="width:700px;height:250px" data-options="singleSelect:true,collapsible:true,url:'Order_get_details.php',method:'post'"> <thead> <tr> <th data-options="field:'ID_O',width:80">ID_O</th> <th data-options="field:'Codice',width:100">Codice</th> <th data-options="field:'Descrizione',width:80,align:'right'">Descrizione</th> <th data-options="field:'Quantita',width:80,align:'right'">Quantità </th> </tr> </thead> </table>
var url; // function open orders details
function openDett() { var row = $('#tt').datagrid('getSelected'); if (row){ $('#win').window('open') url = 'Order_get_details.php?id='+row.id; } }
PHP Order_get_details.php <?php
$id = intval($_REQUEST['id']);
include 'conn.php';
$sql = " select * from Dett_Ordini_Forn where id_o =$id"; $rs = mysql_query ($sql);
$result = array(); while($row = mysql_fetch_object($rs)){ array_push($result, $row); } echo json_encode($result);
?>
|
|
|
|