EasyUI Forum
September 14, 2025, 03:37:44 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / PHP URL POST PROGRESSBAR on: July 18, 2016, 10:44:39 AM
i have a datagrid that i use basically for a shopping cart per say with each row of the datagrid being an object i want to submit.  Example.


COPIES   TITLE
2             ME1
2             ME2
3             ME3
1             ME4
2             ME5

on submit, it will post an url to the server that it sends it to.  I could have numerous rows that the user has selected for post and some rows get dropped from post with the timeout i have set.

Code:
$.messager.confirm('Confirm','Are you sure you want to Submit ' + row1 + ' items?',
  function (r)
  {
  if (r)
  {
for (var i=0; i< rows.length; i++)
  {

grid.datagrid('endEdit',i);
$.ajax({
type: "POST",
cache: true,
url: "jobsubmit.php?ID=" + rows[i].ID + "&copies=" + rows[i].copies + " + &emailfrom=" + emailfrom +"",
//data: postData,
success: function (data, textStatus, jQxhr)
{
$.messager.show
({
  title:'Job Submitted',
  msg:'Thank you for your job submittal.',
  timeout:20000,
  showType:'slide'
  }); //messager.show
   setTimeout( function() {location.reload(); }, 20000);
  }


 How can i show a progress bar while each row gets posted and then keep the screen from being used while its submitted. Then refresh grid when its complete?
2  General Category / EasyUI for jQuery / Numberspinner default in a datagrid on each row on: June 06, 2016, 06:54:10 AM
i want to set the default value for a number spinner which shows up in each row of the datagrid.  Ive tried all i can think of.
<th   data-options="field:'copies',align:'center',width:55, value:1, max:30, editable:'false', formatter:formatField,editor:'numberspinner'">Copies</th>

the value and max do not work.

Thanks in advance
3  General Category / EasyUI for jQuery / edatagrid updateUrl not working on: June 01, 2016, 08:48:18 AM
I have a very simple table with the following as the dg.  I can click in the cell to edit but when i click out of cell nothing happens.  when i refresh table it goes back to original data.


Code:
var bltype = [
    {id:'1',name:'Baseline'},
    {id:'2',name:'IAVA'},
    {id:'3',name:'Other'}
  ];

$(function(){
$('#dg').edatagrid({
url: 'get_baselinedata.php',
saveUrl: 'baseline_save.php',
updateUrl: 'baseline_update.php',
destroyUrl: 'baseline_destroy.php',
autoSave: true,
width: '660px',
        height: '475px',
        halign: 'right'
});
});
</script>

<div id="toolbar">
<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:$('#dg').edatagrid('addRow',{index:0})">New</a>
<!--    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="destroyItem()">Destroy</a>-->
    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="javascript:$('#dg').edatagrid('destroyRow')">Destroy</a>

    <a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="javascript:$('#dg').edatagrid('saveRow')">Save</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="javascript:$('#dg').edatagrid('cancelRow')">Cancel</a>
<!--    <input id="tbsearch" class="easyui-searchbox" data-options="autocomplete:'on',prompt:'Please Input Value',searcher:doSearch"  alighn="right" style="width:300px"/>--> </div>
  <table id="dg" singleSelect="true" align="center" idField="ID" toolbar="#toolbar">
    <thead>
        <tr>
                <th data-options="field:'ID',width:55,sortable:true">ID</th>
                <th data-options="field:'baseline',width:200,align:'left',required:true, editor:'textbox'">Baseline</th>
                <th data-options="field:'baselinetype',width:100,editor:
                                    {type:'combobox',
                                    options:
                                        {valueField:'name',
                                            textField:'name',
                                            data:bltype,
                                            required:true
                                                }
                                     }">Baseline Type</th> 
                <th data-options="field:'del_date',width:90,align:'center',editor:{type:'datebox'}">Delivered Date</th>
                <th data-options="field:'location',width:80,align:'center',editor:'textbox'">Location</th>
</tr>
</thead>
</table>
</div>



baselineupdate.php

<?php
ini_set
('display_errors''On');
error_reporting(E_ALL);


$ID intval($_REQUEST['ID']);
$baseline $_REQUEST['baseline'];
$baselinetype $_REQUEST['baselinetype'];
$del_date $_REQUEST['del_date'];
$location $_REQUEST['location'];

include 
'cmlibraryconn.php';

$sql="update delivered set baseline='$baseline', baselinetype='$baselinetype',del_date='$del_date', location='$location' where ID=$ID";

@
mysql_query($sql);
echo 
json_encode(array(
    
'ID' => $ID,
'baseline' => $baseline,
'baselinetype' => $baselinetype,
'del_date' => $del_date,
   
'location' => $location
));
?>

4  General Category / EasyUI for jQuery / Re: Two identical records in DataGrid on: March 23, 2016, 08:06:34 AM
this should be part of the build itself.  this just saved me a ton of work!

Thank you!!!!
5  General Category / EasyUI for jQuery / Re: Submit multiple rows to php url with one submit on: March 15, 2016, 03:35:32 PM
i figured it out and this is how im doing it.

Code:
function getCart() {
        var emailfrom = $('#emailfrom').val();
        var rows = $('#cart').datagrid('getRows');
        var data = {};
var grid = $('#cart');
var rows = grid.datagrid('getRows');
$.messager.confirm('Confirm','Are you sure you want to Submit cart?',
  function (r)
  {
  if (r)
  {
  for (i=0; i< rows.length; i++)
  {
  url = "echo.php?ID=" + rows[i].ID + "&copies=" + rows[i].copies + " + &emailfrom=" + emailfrom +"";
  $.post(url);
  }
  $.messager.show(
  {
  title:'Job Submitted',
  msg:'Thank you for your job submittal.',
  timeout:5000,
  showType:'slide'
  }); //messager.show
  setTimeout( function() {location.reload(); }, 5000);
  }
  else
  {
  return false;
  }
  });
}
6  General Category / EasyUI for jQuery / Submit multiple rows to php url with one submit on: March 15, 2016, 09:13:03 AM
I have a datagrid that i want to submit all the rows to a php url and i can get it to submit but it asks the success for each one i submit.  i know im missing something easy.  Here is my code.

Code:
function getCart() {
        var ids = [];
        var titles = [];
        var descritptions = [];
        var output = "";
        var rows = $('#cart').datagrid('getRows');
        var emailfrom = $('#emailfrom').val();
var datastring = "ID=" + rows[i].ID + "&copies=" + rows[i].copies + "&emailfrom=" + emailfrom +"";
for (var i = 0; i < rows.length; i++)
{
$.ajax({
type: "POST",
url:"echo.php",
data:datastring,
cache: false,
success:  function(result)
{
$.messager.confirm('Confirm','Are you sure you want to Submit cart?',
function (r)
{
if (r)
{
$.messager.show({
  title:'Job Submitted',
  msg:'Thank you for your job submittal.',
  timeout:5000,
  showType:'slide'
  }); //messager.show
            setTimeout( function() {location.reload(); }, 5000);
}
  else
{
return false;
}

});
}

});

}
7  General Category / EasyUI for jQuery / Re: Datagrid search php mysql on: March 10, 2016, 08:39:56 AM
thank you for your reply and believe it or not i got it working after i posted this LOL..

This is how i got it to work.  something to do with if you are using double quotes, then your variables have to be in brackets... go figure...

Original:
$rs = mysql_query("SELECT `description`.*,`media`.`media_type` FROM `description` RIGHT OUTER JOIN `media` ON (`media`.`media_type` = `description`.`MEDIA_TYPE`) WHERE " . $where . " order by $sort $order limit $offset,$rows ") ;

NEW:
$rs = mysql_query("SELECT `description`.*,`media`.`media_type` FROM `description` RIGHT OUTER JOIN `media` ON (`media`.`media_type` = `description`.`MEDIA_TYPE`) WHERE {$where} order by $sort $order limit $offset,$rows ") ;
8  General Category / EasyUI for jQuery / Datagrid search php mysql on: March 09, 2016, 03:44:49 PM
Can someone PLEASE tell me why this doesn't work?  ive racked my brain till i dont have one anymore....

if i take out the where " . $where . " it works but the search function fails.
If i do a SELECT * from description where " . $where . "  it works fine but the media_type is wrong.

PLEASE HELP!!  Grin

Code:
<?php
include 'conn.php';


$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 10;
$sort = isset($_POST['sort']) ? strval($_POST['sort']) : 'ID';
$order = isset($_POST['order']) ? strval($_POST['order']) : 'desc';
$ID = isset($_REQUEST['ID']) ? mysql_real_escape_string($_REQUEST['ID']) : '';
$TITLE = isset($_REQUEST['TITLE']) ? mysql_real_escape_string($_REQUEST['TITLE']) : '';
$DESCRIPTION = isset($_REQUEST['DESCRIPTION']) ? mysql_real_escape_string($_REQUEST['DESCRIPTION']) : '';
$VERSION = isset($_REQUEST['VERSION']) ? mysql_real_escape_string($_REQUEST['VERSION']) : '';
$filterRules = isset($_POST['filterRules']) ? ($_POST['filterRules']) : '';
$cond '1=1';
if (!empty($filterRules)){
$filterRules json_decode($filterRules);
print_r ($filterRules);
foreach($filterRules as $rule){
$rule get_object_vars($rule);
$field $rule['field'];
$op $rule['op'];
$value $rule['value'];
if (!empty($value)){
if ($op == 'contains'){
$cond .= " and ($field like '%$value%')";
} else if ($op == 'greater'){
$cond .= " and $field>$value";
}
}
}
}
$offset = ($page-1)*$rows;
$result = array();
$where "ID like '%$ID%' OR TITLE like '%$TITLE%' or DESCRIPTION like '%$DESCRIPTION%' or VERSION like '%$VERSION%' ";
$rs mysql_query("select count(*) from description where " $where);
$row mysql_fetch_row($rs);
$result["total"] = $row[0];
$rs mysql_query("SELECT `description`.*,`media`.`media_type` FROM `description` RIGHT OUTER JOIN `media` ON (`media`.`media_type` = `description`.`MEDIA_TYPE`) WHERE " $where " order by $sort $order limit $offset,$rows ") ;

$items = array();
while($row mysql_fetch_object($rs)){
array_push($items$row);
}
$result["rows"] = $items;
//$checked = $result['REQUEST'];
echo json_encode($result);
?>


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