Show Posts
|
Pages: [1] 2
|
3
|
General Category / EasyUI for jQuery / help datagrid filter
|
on: January 24, 2018, 02:49:08 AM
|
I'm trying to use the example of a data grid filter. datagrid.html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>jQuery EasyUI Demo</title> <link rel="stylesheet" type="text/css" href="css/easyui.css"> <link rel="stylesheet" type="text/css" href="css/icon.css"> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.easyui.min.js"></script> <script type="text/javascript" src="js/comp.js"></script>
<style> .icon-filter{ background:url('filter.png') no-repeat center center; } </style> </head> <body> <h1>DataGrid Filter Row</h1> <table id="dg" title="DataGrid" style="width:700px;height:250px" data-options=" singleSelect:true, data:data "> <thead> <tr> <th data-options="field:'itemid',width:80">Item ID</th> <th data-options="field:'productid',width:100">Product</th> <th data-options="field:'listprice',width:80,align:'right'">List Price</th> <th data-options="field:'unitcost',width:80,align:'right'">Unit Cost</th> <th data-options="field:'attr1',width:250">Attribute</th> <th data-options="field:'status',width:60,align:'center'">Status</th> </tr> </thead> </table> </body> </html> and comp.js var data = [ {"productid":"FI-SW-01","productname":"Koi","unitcost":10.00,"status":"P","listprice":36.50,"attr1":"Large","itemid":"EST-1"}, {"productid":"K9-DL-01","productname":"Dalmation","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST-10"}, {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":38.50,"attr1":"Venomless","itemid":"EST-11"}, {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":26.50,"attr1":"Rattleless","itemid":"EST-12"}, {"productid":"RP-LI-02","productname":"Iguana","unitcost":12.00,"status":"P","listprice":35.50,"attr1":"Green Adult","itemid":"EST-13"}, {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"N","listprice":158.50,"attr1":"Tailless","itemid":"EST-14"}, {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":83.50,"attr1":"With tail","itemid":"EST-15"}, {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":23.50,"attr1":"Adult Female","itemid":"EST-16"}, {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"N","listprice":89.50,"attr1":"Adult Male","itemid":"EST-17"}, {"productid":"AV-CB-01","productname":"Amazon Parrot","unitcost":92.00,"status":"N","listprice":63.50,"attr1":"Adult Male","itemid":"EST-18"} ]; $(function(){ var dg = $('#dg').datagrid({ filterBtnIconCls:'icon-filter' }); dg.datagrid('enableFilter', [{ field:'listprice', type:'numberbox', options:{precision:1}, op:['equal','notequal','less','greater'] },{ field:'unitcost', type:'numberbox', options:{precision:1}, op:['equal','notequal','less','greater'] },{ field:'status', type:'combobox', options:{ panelHeight:'auto', data:[{value:'',text:'All'},{value:'P',text:'P'},{value:'N',text:'N'}], onChange:function(value){ if (value == ''){ dg.datagrid('removeFilterRule', 'status'); } else { dg.datagrid('addFilterRule', { field: 'status', op: 'equal', value: value }); } dg.datagrid('doFilter'); } } }]); });
the example as it is written works, but if I try to put the script in an external file, but the filter no longer works, where am I wrong?
|
|
|
4
|
General Category / EasyUI for jQuery / Re: submit form with link button
|
on: November 18, 2017, 09:17:11 AM
|
I tried, but they did not work.
the first and the second solution works partially because it does not send me to the "controllers / login.php" page and reload the same page.
I should send the "login.php" data form for the user's verification in the DB and chase the main page (of course with login control in the open session)
|
|
|
6
|
General Category / EasyUI for jQuery / submit form with link button
|
on: November 18, 2017, 02:09:17 AM
|
how can you use the link button to submit a form without ajax? because i have problems using ajax. If I use the classic <input type="submit" value="Submit"> works the post variables are sent, but if I use <a href="controllers/login.php" class="easyui-linkbutton" onclick="$('#flogin').submit();" style="width:80px">Submit</a> the variables they are not sent or read. code HTML index.php
<body> <div id='win'>
<form id="flogin" action='controllers/login.php' method="post"> <div style="margin-bottom:20px ; margin-top:20px" > <input id="user" type="text" name="utente"> </div> <div style="margin-bottom:20px"> <input id="pwd" type="password" name="password"> </div> <input type="hidden" id="dbinuso" value="frasema" /> <a href="javascript:void(0)" class="easyui-linkbutton" onclick="sublogin()" style="width:80px">Submit</a>
</form>
</div> <script type="text/javascript" src="js/login.js"></script> </body> where #win is an window code JAVASCRIPT login.js function sublogin(){ $('#flogin').form('submit',{ success:function(data){ window.location.href = 'controllers/login.php'; } }) code PHP login.php <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> </head> <body> <?php echo ($_POST['utente']);
?>
PAGINA 'login.php' </body> </html> you only see: PAGINA 'login.php' can anyone help me find a solution with or without ajax?
|
|
|
10
|
General Category / EasyUI for jQuery / [solved] input (textbox) set focus
|
on: October 31, 2017, 05:39:52 AM
|
I have a problem setting focus in textbox in a modal windows form. the HTML code: <form id = "ff" method = "post"> <div style = "margin-bottom: 20px"> <input id = "user" type = "text" name = "user"> </ Div> .... the javascript code: $ ( '# User'). Textbox ({ label: 'Password:', labelPosition: 'top', required: true, width: 80% ', });
$ ( '# User'). Textbox.focus ();
but it does not work, where am I wrong?
|
|
|
12
|
General Category / EasyUI for jQuery / speed query execution
|
on: November 28, 2016, 02:12:13 AM
|
it is possible that the execute bit of a query (select) with 2 fields and the same with 8 fields (1000 records), the page load times with datagrid (url: file.php) range from 3 seconds to 30 seconds? $sql = "SELECT idCliente,cognome,nome,codFisc,via,tel,telCell,note FROM clienti ORDER BY idCliente DESC "; try { $stmt = $DB->prepare($sql); $stmt->execute(); $results = $stmt->fetchAll(); } catch (Exception $ex) { printErrorMessage($ex->getMessage()); } $returnArray = array(); if (count($results) > 0) { foreach ($results as $rs) { $returnArray[] = $rs; } } echo json_encode($returnArray);
|
|
|
14
|
General Category / EasyUI for jQuery / widgets creation with javascript
|
on: November 08, 2016, 01:09:50 AM
|
I have problems with the creation of widgets using javascript. taking for example the linkbutton, with markdown mosta me icon, and with no javascript. I copied verbatim the related tutorial code, let me know where I'm wrong. you can have a code sample to set the properties, events and methods (I admit that I'm ignorant on the use of javascript)? thanks for help
|
|
|
|