EasyUI Forum
June 22, 2024, 03:27:44 AM *
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 / General Discussion / Re: Help Me, Datagrid footer rows using database MySQL on: February 15, 2013, 01:25:55 AM
hi, here my way. (notice i´m ab beginner in EasyUI )

php get data (post Insert, Update and Delete is in a other file.)
Code:
<?php
include '../include/funktion.php'// mysql conn etc.

// table
$dbtabelle 'Menue';

$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 10;
$sort = isset($_POST['sort']) ? strval($_POST['sort']) : 'Position';
$order = isset($_POST['order']) ? strval($_POST['order']) : 'asc';

$offset = ($page-1)*$rows;

$result = array();
// Suche -------------

if(isset($_POST['Suche']) && !empty($_POST['Suche'])) {
$Suche mysql_real_escape_string($_POST['Suche']) ;

$where " WHERE   objekt_nr LIKE '%$Suche%'
OR Position LIKE '%
$Suche%'
OR Text like '%
$Suche%'
OR href like '%
$Suche%'
OR onclick like '%
$Suche%'
OR icon like '%
$Suche%'
OR QEclass like '%
$Suche%'
OR data_options like '%
$Suche%'
OR Breite like '%
$Suche%'
OR target like '%
$Suche%' ";
}
else { $where '';}

// total -------------
$rs mysql_query("SELECT COUNT(*) FROM $dbtabelle $where");
$row mysql_fetch_row($rs);
$result["total"] = $row[0];

// rows ---------------
$rs mysql_query("SELECT * FROM $dbtabelle $where ORDER BY $sort $order LIMIT $offset,$rows");

$items = array();
while(
$row mysql_fetch_object($rs)) {
array_push($items$row);
}
$result["rows"] = $items;

// SUM() for footer --------------------
$rs mysql_query("SELECT SUM(objekt_nr) AS objekt_nr, SUM(Position) AS Position FROM $dbtabelle $where");

while (
$row mysql_fetch_array($rs)) {
$entry = array( 'objekt_nr' => 'Summe''Position' => euro($row['Position']), );
$jsonData[] = $entry;
}
$result["footer"] = $jsonData;

header("Content-type: application/json");
echo 
json_encode($result);
?>
regards Peter
2  General Category / EasyUI for jQuery / Re: NumberBox input how to replace dot with a comma on: February 13, 2013, 01:28:41 PM
thanks it work.

i place the code in  $(document).ready(function() 
Code:
    $(document).ready(function() {
$('#nn').numberbox().unbind('keypress.numberbox').bind('keypress.numberbox',function(e){
if (e.which == 45){ //-
if ($(this).val().indexOf('-') == -1){
return true;
} else {
return false;
}
} if (e.which == 46 || e.which == 44) { //.,
if ($(this).val().indexOf('.') == -1){
return true;
} else {
return false;
}
}
else if ((e.which >= 48 && e.which <= 57 && e.ctrlKey == false && e.shiftKey == false) || e.which == 0 || e.which == 8) {
return true;
} else if (e.ctrlKey == true && (e.which == 99 || e.which == 118)) {
return true;
} else {
return false;
}
    });
   });

it don’t work in "easyui-layout" loadet files.
called with
Code:
function center37(){ $('#p').panel('refresh','include/NumberBox.php'); }

I see a lot to learn for me.

can i have a hint please
3  General Category / EasyUI for jQuery / NumberBox input how to replace dot with a comma on: February 12, 2013, 04:30:20 AM
Hi, i try to use this great project in a German business app.

The NumberBox works fine for display the numbers as we needed.
By typing in the <input> field with a German keyboard we have a comma "," on the keyboard nunberblock.

How to chance it to accept the comma at type in and replace(',' , '.') for use in code. 
it is necessary to use jQuery EasyUI in most European countries.

ahead thanks for a hint.

Peter

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