Show Posts
|
Pages: [1] 2 3 ... 8
|
4
|
General Category / EasyUI for jQuery / Re: CRUD example vs Data grid example issues?
|
on: October 02, 2014, 02:44:21 AM
|
Hope this will work. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="flight"> <meta name="description" content="Flight Assingment data grid"> <title>Flight Assignment</title> <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/black/easyui.css"> <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css"> <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/demo/demo.css"> <style type="text/css"> #fm{ margin:0; padding:10px 30px; font-size:18px; } .ftitle{ font-size:32px; font-weight:bold; color:#666; padding:5px 0; margin-bottom:10px; border-bottom:1px solid #ccc; } .fitem{ margin-bottom:5px; font-size:18px; } .fitem label{ display:inline-block; width:80px; font-size:18px; } </style> <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script> <script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script> <script type="text/javascript"> var url; function newUser(){ $('#dlg').dialog('open').dialog('setTitle','New User'); $('#fm').form('clear'); url = 'save_user.php'; } function editUser(){ var row = $('#dg').datagrid('getSelected'); if (row){ $('#dlg').dialog('open').dialog('setTitle','Edit User'); $('#fm').form('load',row); url = 'update_user.php?id='+row.id; } } function saveUser(){ $('#fm').form('submit',{ url: url, onSubmit: function(){ return $(this).form('validate'); }, success: function(result){ var result = eval('('+result+')'); if (result.success){ $('#dlg').dialog('close'); // close the dialog $('#dg').datagrid('reload'); // reload the user data } else { $.messager.show({ title: 'Error', msg: result.msg }); } } }); } function removeUser(){ var row = $('#dg').datagrid('getSelected'); if (row){ $.messager.confirm('Confirm','Are you sure you want to remove this flight?',function(r){ if (r){ $.post('remove_user.php',{id:row.id},function(result){ if (result.success){ $('#dg').datagrid('reload'); // reload the user data } else { $.messager.show({ // show error message title: 'Error', msg: result.msg }); } },'json'); } }); } } //} something's wrong here!! </script> </head> <body bgcolor="#3d3d3d"> <table id="dg" title="Flight Assignment" class="easyui-datagrid" style="width:925px;height:1100px" url="get_users.php" toolbar="#toolbar" data-options=" pagination:true, rownumbers:true, fitColumns:true, singleSelect:true, "> <thead> <tr> <th data-options="field:'date',width:40">DATE</th> <th data-options="field:'cycle',width:20">CYCLE</th> <th data-options="field:'pilot',width:50">PILOT</th> <th data-options="field:'pstatus',width:25">STATUS</th> <th data-options="field:'tfo',width:50">TFO</th> <th data-options="field:'callsign',width:30">CALL SIGN</th> <th data-options="field:'psgrs',width:20">PSGRS</th> <th data-options="field:'acft',width:20">ACFT</th> <th data-options="field:'dest',width:25">DEST</th> <th data-options="field:'depart',width:25">DEPART</th> <th data-options="field:'arrive',width:25">ARRIVE</th> </tr> </thead> </table> <div id="toolbar"> <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newUser()">New Flight</a> <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editUser()">Edit Flight</a> <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" plain="true" onclick="removeUser()">Remove Flight</a> </div> <div id="dlg" class="easyui-dialog" style="width:400px;height:500px;padding:10px 20px" closed="true" buttons="#dlg-buttons"> <div class="ftitle">Flight Information</div> <form id="fm" method="post" novalidate> <div class="fitem"> <label>Date:</label> <input name="date" class="easyui-validatebox" required="true"> </div> <div class="fitem"> <label>Cycle</label> <input name="cycle" class="easyui-validatebox" required="true"> </div> <div class="fitem"> <label>Pilot:</label> <input name="pilot" class="easyui-validatebox" required="true"> </div> <div class="fitem"> <label>Pilot Status:</label> <input name="pstatus" class="easyui-validatebox" required="true"> </div> <div class="fitem"> <label>TFO:</label> <input name="tfo" class="easyui-validatebox" required="true"> </div> <div class="fitem"> <label>Call Sign:</label> <input name="callsign" class="easyui-validatebox" required="true"> </div> <div class="fitem"> <label>PSGRS:</label> <input name="psgrs" class="easyui-validatebox" required="true"> </div> <div class="fitem"> <label>ACFT:</label> <input name="acft" class="easyui-validatebox" required="true"> </div> <div class="fitem"> <label>DEST:</label> <input name="dest" class="easyui-validatebox" required="true"> </div> <div class="fitem"> <label>Depart:</label> <input name="depart" class="easyui-validatebox" required="true"> </div> <div class="fitem"> <label>Arrive:</label> <input name="arrive" class="easyui-validatebox" required="true"> </div> </form> </div> <div id="dlg-buttons"> <a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveUser()">Save</a> <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">Cancel</a> </div> </body> </html>
|
|
|
6
|
General Category / EasyUI for jQuery / Combobox with a special character!!
|
on: September 24, 2014, 08:19:33 PM
|
I have no idea how to deal with those special characters. Please see below: <input class="easyui-combobox" data-options=" valueField: 'label', textField: 'value', data: [{ label: 'java', value: 'alc\\o\\h//ol' },{ label: 'perl', value: 'mr. john's' },{ label: 'ruby', value: '<script>alert(\'testggg\');</\script>' }]" />
How can i make all of that to display as it was ? please help!!
|
|
|
7
|
General Category / EasyUI for jQuery / Combobox: select with 'group' property
|
on: September 19, 2014, 07:23:16 PM
|
Can you tell me if i'd be able to use 'group' property with 'select'. <select data-options=' method: "get", multiple:false, valueField:"value", textField:"text", groupField:"group" ' > <option >Text in group1</option> <option >Text in group2</option> <option >Text in group3</option> </select>
|
|
|
|