EasyUI Forum
April 29, 2024, 12:20:24 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1] 2
1  General Category / EasyUI for jQuery / Passing Value From Dropbox 2 on: June 08, 2020, 01:16:48 PM
I think that narrowing it down what I need is to get the value from the dropbox and send it to the call of the .php file.
This is the form with the dropbox which is filling with records fine.:
   <div id="dlg" class="easyui-dialog" style="width:450px;height:250px;padding:10px 20px"
        closed="true" buttons="#dlg-buttons">
       <div class="ftitle">Assign medic to practiotioner</div>
       <form id="fm" method="post" novalidate>
           <div class="fitem">
               <input class="easyui-combobox" id="dd_medicid" name="dd_medicid" style="width:350px; margin-bottom:20px" limitToList: true; data-options="
                           url:'./getmedicnames.php',
                           method:'get',
                           valueField:'medicid',
                           textField:'certname',
                      panelHeight:400,
                           label: 'Medic Name:',
                           labelPosition: 'top'
                           ">
           </div>
       </form>
   </div>
   <div id="dlg-buttons">
      <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="editUser()" style="width:90px">Save</a>
      <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')" style="width:90px">Cancel</a>

This is the editcode that is called.
   function editUser(){
       $('#dlg').dialog('open').dialog('setTitle','New Assignment');
       $('#fm').form('clear');
       url = './AssignMedictoPractitioner.php?medicid='+dd_medicid.valueField;
         $('#dg').datagrid('reload');    // reload the current page data
   }



Thanks for your help.

Steve.
2  General Category / EasyUI for jQuery / Passing dropbox value to php file on: June 08, 2020, 12:29:45 PM
Hi There,

I'm sure I am doing everything totally wrong but I'm stuck and really need your help.

I have an easyui grid and when I click a button it opens a dialog window with a dropdown. I would like to send the chosen value to a .php file to change a value in my database. below is part of the code of my page with the grid, button and dialog with the dropdown. And below that is my .php code.

<body>

    <p></p>
    <?php echo "Today is: " . date('l jS \of F Y')?>
   <table id="dg" title="Medic Booking" class="easyui-datagrid" style="width:970px;height:600px"
        <?php echo "url=get_rei_practitionerscerts.php?id=" . $passedid ?>
        toolbar="#toolbar" pagination="true" pageSize="20"
        rownumbers="true" fitColumns="true" singleSelect="true">
      <thead>
         <tr>
            <th field="practitionerid" width="200">PracID</th>
            <th field="certname" width="200">Medic Name</th>
            <th field="date1" width="90" align="center" styler="cellStyler">Date 1</th>
            <th field="time1" width="70" align="center">Time 1</th>
            <th field="date2" width="90" align="center" styler="cellStyler">Date 2</th>
            <th field="time2" width="70" align="center">Time 2</th>
            <th field="date3" width="90" align="center" styler="cellStyler">Date 3</th>
            <th field="time3" width="70" align="center">Time 3</th>
            <th field="date4" width="90" align="center" styler="cellStyler">Date 4</th>
            <th field="time4" width="70" align="center">Time 4</th>
        <th field ="detail" width = "40" align="center" formatter="formatDetail">View</th>
      </tr>
      </thead>
   </table>
   <div id="toolbar">
      <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newBooking()">New Booking</a>
      <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="destroyBooking()">Delete Booking</a>
      <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-home" plain="true" onclick="href='index-reiki.php'">Home</a>
   </div>
   
  <?php include("includes/footer.php") ?>

   <div id="dlg" class="easyui-dialog" style="width:450px;height:250px;padding:10px 20px"
        closed="true" buttons="#dlg-buttons">
       <div class="ftitle">Assign medic to practiotioner</div>
       <form id="fm" method="post" novalidate>
           <div class="fitem">
               <input class="easyui-combobox" name="dd_medicid" style="width:350px; margin-bottom:20px" limitToList: true; data-options="
                           url:'./getmedicnames.php',
                           method:'get',
                           valueField:'medicid',
                           textField:'certname',
                      panelHeight:400,
                           label: 'Medic Name:',
                           labelPosition: 'top'
                           ">
           </div>
       </form>
   </div>
   <div id="dlg-buttons">
      <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="editUser()" style="width:90px">Save</a>
      <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')" style="width:90px">Cancel</a>
   </div>
   
   <div id="multiusage"></div>
  <script type="text/javascript">
    var url;

      function editUser(){
         var row = $('#dg').databobox.datagrid('getSelected');
         if (row){
            $('#dlg').dialog('open').dialog('setTitle','Edit User');
        $('#fm').form('load',row);
        url = './AssignMedictoPractitioner.php?medicid='+dd_medicid.medicid;
      }
         $('#dg').datagrid('reload');    // reload the current page data
      }
 PHP Code:
<?php
$db_host = "127.0.0.1";
$db_username = "root";
$db_password = "";
$db = "pracdb";
$conn = new mysqli($db_host,$db_username,$db_password,$db) or die(mysqli_error());
$medicid = intval($_POST['medicid']);

$sql = "update medics set practitionerid=2 where medicid=" . $medicid;

?>

Thanks,

Steve.
3  General Category / EasyUI for jQuery / Re: Time format in grid on: June 06, 2020, 09:43:06 AM
Hi There,

I can get the code below to work in MySqladmin but when I add it to a mysql call in EasyUI it does not work. More than likely a syntax error.

SELECT certname,
DATE_FORMAT(TIME1,'%k:%i') AS 'Time1',
DATE_FORMAT(TIME2,'%k:%i') AS 'Time2',
DATE_FORMAT(TIME3,'%k:%i') AS 'Time3',
DATE_FORMAT(TIME4,'%k:%i') AS 'Time4'
FROM order

Below is the code I have in my EasyUI index.php
<th field="time1" width="70" align="center">Time 1</th>  but how do I add the, DATE_FORMAT(TIME1,'%k:%i') AS 'Time1', bit

Does anyone know the correct syntax or have any idea why it doesn't work?

Best Regards,

Steve.
4  General Category / EasyUI for jQuery / Time format in grid on: June 04, 2020, 12:58:16 PM
Hi There,

Can someone help me with the format of a time field in an easyui grid. it is showing as "20:23:09" and I would like to just keep the hours and minutes "20:23" how can I do that?

Thanks for your help.

Best Regards,

Steve.
5  General Category / EasyUI for jQuery / Re: Getting field value from form on: December 20, 2019, 02:31:40 PM
Hi stworthy,

Thanks for the reply.
I tried the code adapted a little like this:
            values = $('#ff').serializeArray();
            // find  the value you expect
            var item = values.filter(item => item.name === 'site');
            $.messager.alert('Message','Site is:<br /><br />' . item,'error');
But I get the attached returned:

Any idea why.

Best Regards,

Steve.
6  General Category / EasyUI for jQuery / Getting field value from form on: December 18, 2019, 09:27:59 AM
Hi There,

I have a form and would like to get the value of a field in that form. So if I have this form:
    <form enctype="multipart/form-data" id="ff" name="ff" method="post">
        <table border="0" style="margin-top:20px;width: 100%;" >
            <tr>
                <label>Site:</label>
                <input name="site" id="site" style="width: 190px;" class="easyui-textbox" >
            </tr>
            <tr>
                <label>Job:</label>
                <input name="job" id="job" style="width: 190px;" class="easyui-textbox" >
            </tr>
            <tr>
                <td><input id="fb" name="userfile[]" type="text" style="width: 100%;" ></td>
                <td style="width: 90px; text-align: right;"><a id="btn-upload" href="javascript:void(0)">Upload</a> </td>           
            </tr>
        </table>
    </form>
 how do I get the vale of the field with id="site"

Thanks for your help.

Best Regards,

Steve.
7  General Category / EasyUI for jQuery / form layout on: November 11, 2019, 05:35:12 AM
Hi There,

I have used the CRUD demo example as a starting point and the forms seem to have all the fields in a linear fashion.
How can I code the form to have fields side by side I.E firstname on the left and lastname on the right.

Thanks for the help.

Best Regards,

Steve.
8  General Category / EasyUI for jQuery / Re: Using Checkbox on: November 11, 2019, 03:43:28 AM
Hi Jahangir,

Thank you for your reply.
So when I come to edit the record will the checkbox be shown as checked in the form if it's set in the record?

Best Regards,

Steve.
9  General Category / EasyUI for jQuery / Using Checkbox on: November 09, 2019, 03:34:27 AM
Hi There,

I'm having an issue using a checkbox.
I want to use one checkbox to show something is Active or In-Active.
If it's checked it means active if not checked it's in-active.
On the form declaration it has a value of 0, so it starts off unchecked.
<input class="easyui-checkbox" name="active" value="0" label="Active:">

When I call the save or update how can I know if the checkbox is checked or not.

Thanks for the help.

Best Regards,

Steve.
10  General Category / EasyUI for jQuery / Re: Getting error on message on: November 09, 2019, 03:24:00 AM
Hi Jahangir,

Thanks for your reply. All working now.

Best Regards,

Steve.
11  General Category / EasyUI for jQuery / Getting error on message on: November 08, 2019, 03:10:05 PM
Hi There,

I am deleting a record and when I get a message asking am I sure I want to delete there is an odd [object] [object] at the end of the text. (please see attachment)

This is the code calling the messageBox:
    function destroyCert(){
        var row = $('#dg').datagrid('getSelected');
        if (row){
            $.messager.confirm('Confirm','Are you sure you want to delete this certificate?' + row,function(r){
                if (r){
                    $.post('destroy_cert.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.errorMsg
                            });
                        }
                    },'json');
                }
            });
        }
    }

Thanks for your help.

Best Regards,

Steve.
12  General Category / EasyUI for jQuery / Re: Add icon to iconCls on: November 08, 2019, 02:26:50 PM
Hi Jahangir,

Thank you for your help, all working now.

Best Regards,

Steve.
13  General Category / EasyUI for jQuery / Add icon to iconCls on: November 07, 2019, 06:45:56 AM
Hi There,

Can someone tell me how I add a new icon to iconCls?

I need an icon-home for my home button.

Thanks for your help.

Best Regards,

Steve.
14  General Category / EasyUI for jQuery / setting chckbox in grid unclickable on: November 06, 2019, 11:41:39 AM
Hi There,

Your help please.

In a grid I am showing checkboxes for 1 of my fields using this code:
function formatCheck(val,row){
    if (val == '1') {
   return '<input type="checkbox" checked>';
    }
    else {
   return '<input type="checkbox">';
   }
}

But users can click on the checkbox in the grid and change checked/unchecked. How do I stop that so if the user clicks on a checkbox nothing happens.

Thanks for your help.

Best Regards,

Steve.


15  General Category / EasyUI for jQuery / Grid Selection is not working on: November 05, 2019, 02:51:27 PM
Hi There,

For some reason my grid selection is not working when I choose the button to delete a record.
I have attached the relevant file with the code.
on the grid I have a button with onclick="destroyCert()" but the destroyCert() function does not get the row from the "var row = $('#dg').datagrid('getSelected');" code. Can anyone see why?

Any help would be appreciated.

Best Regards,

Steve.
Pages: [1] 2
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!