EasyUI Forum
May 16, 2024, 10:08:59 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 / EasyUI for jQuery / Re: how to set datagrid row header? on: November 15, 2013, 12:45:58 AM
thx a lot for your effort on helping. i will try figure it out.
2  General Category / EasyUI for jQuery / Re: how to set datagrid row header? on: November 14, 2013, 10:28:49 PM
honestly, i have no code at the moment cause i have no idea how it to be done.
but i did plot in excel for my example. which i snap in the picture.

first i need a list of user(header of each row). Then, i need a list of apps(header of each column).
then i am plotting the data among each cell for individual user vs apps for each privilege.
3  General Category / EasyUI for jQuery / Re: how to set datagrid row header? on: November 14, 2013, 09:07:17 PM
any idea of using php?
i am not familir with javascript yet. but why do i need post at the begining?
4  General Category / EasyUI for jQuery / Re: how to set datagrid row header? on: November 14, 2013, 08:17:05 PM
I don't find any example of setting it.
If you could provide both, will be very much appreciate it.
5  General Category / EasyUI for jQuery / how to set datagrid row header? on: November 13, 2013, 08:33:14 PM
hi
I wonder does anyone did row header for datagrid before?
mind to give some example on decorate it?
6  General Category / EasyUI for jQuery / how to disable / enable dialog shadow? on: October 14, 2013, 02:19:18 AM
i am having display problem after load a dialog form.
the shadow not display according to windows size.
how do i "refresh" or call the dialog shadow manually?
7  General Category / EasyUI for jQuery / Re: Does easyui form support multiple file upload? on: October 11, 2013, 07:48:02 PM
sorry all, called a wrong variable. I should call $_FILES instead of $_POST
8  General Category / EasyUI for jQuery / [SOLVED] Does easyui form support multiple file upload? on: October 11, 2013, 07:18:02 PM
Dear All,
I experienced of form post with multiple file element named "MultiFileUpload[]" but $_POST['MultiFileUpload'] says "Notice: Undefined index: MultiFileUpload".
can anyone help?
9  General Category / EasyUI for jQuery / need help on datagrid search on: September 29, 2013, 07:42:41 PM
i have difficulty to get the search work. for my first horizontal tab with first vertical tab, the datagrid work fine with search etc.
But when come to third, 4th, the search input field passing empty data, my option has no value.
Can anyone help?


here is my code

home.php
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>Material DO</title>

<link rel="stylesheet" type="text/css" href="css/easyui.css">
<link rel="stylesheet" type="text/css" href="css/icon.css">
<link rel="stylesheet" type="text/css" href="css/demo.css">


<script type="text/javascript" src="js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
</head>

<script type='text/javascript'>

$(document).ready(function(){


$tabsp = $('#tabsProject');
var pselectedindex = -1;
var mselectedindex = -1;


    $(window).resize(function(){

$("div.easyui-tabs").each(function() {
if($(this).is(':visible'))
$(this).tabs('resize',{})
})

$('table.easyui-datagrid').datagrid('resize');



    });


$tabsp.tabs({
onSelect: function(title, index){
if (pselectedindex != index)
{

var p = $tabsp.tabs('getSelected');  // get the selected tab panel
var  pid = p.panel('options').id.substr(4);
pselectedindex = index;
mselectedindex = -1;

$("div.easyui-tabs").each(function() {
if($(this).is(':visible'))
if($(this).attr('id') != 'tabsProject')
$(this).tabs({
onSelect: function(title, index){

if (mselectedindex != index)
{
var mp = $(this).tabs('getSelected');
var mid = mp.panel('options').id.substr(5);

mselectedindex = index;
mp.panel({
href:'load.do.grid.php?ProjectId='+ pid + '&MaterialId='+ mid

})
console.log($(this).attr('id') + ': '+ $('#tab').attr('id'));

}
}
})




});

};
}
})


})




   
</script>


<body>
<?php

require_once("connectdb.php");
require_once(
"..\common\html.php");

$psql "
SELECT
ProjectId,
ProjectName,
GroupName
FROM
Project
WHERE Status <> 1
ORDER BY
ProjectName
"
;

$msql "
SELECT
MaterialId,
MaterialName
FROM
materialtype
ORDER BY
MaterialName
"
;

echo '<div class="easyui-tabs" id="tabsProject" tabWidth="150px"  >';

if ($presult $mysqli->query($psql) )
while($prow $presult->fetch_assoc() )
{
echo '<div title="'.$prow['ProjectName'].'" id="tab-'.$prow['ProjectId'].'" 
data-options="fitcolumns:true", fit:true,  border:false '
.
' style="padding:5px;" >';

echo '<div id="mat-'.$prow['ProjectId'].'" class="easyui-tabs" tabPosition="left" headerWidth="200" style="padding:5px;"
data-options="fitcolumns:true, border:true ">'
;
if ($mresult $mysqli->query($msql) )
while( $mrow $mresult->fetch_assoc() )
{
echo '<div title="'.$mrow['MaterialName'].'" id="'.$prow['ProjectId'].'-'.$mrow['MaterialId'].'" style="padding:5px;" >';
echo '</div>';
};
echo '</div> <!-- M-'$prow['ProjectId'] .'tabs -->';



echo '</div>';
};

echo '</div> <!--class="easyui-tabs"-->';

?>

</body>
</html>

here is the code for load.do.grid.php
Code:

<?php

require_once('connectdb.php');

echo 
'
<table id="dgMaterial" title="Material DO" class="easyui-datagrid" style="width:auto; height:auto" toolbar="#tb"
data-options=" singleSelect:true, 
fitColumns:true,  
pagination:true,
rownumbers:true,
pageList:[20,50,100],
pageSize:20,
pagePosition:\'both\',
url:\'get.do.json.php\',
queryParams:{
ProjectId:\'' 
$_GET['ProjectId'] . '\', 
\'MaterialId\':\'' 
$_GET['MaterialId'] . '\',
keywords: $(\'#keywords\').val(),
Rec: $(\'#Rec\').val()
}
">'
;
echo 
'<thead>';


echo
'     <tr>';
/* custom define header with specific width size */
echo '<th data-options=" field:\'DoId\'" width="60">Do Id</th>';
echo '<th data-options=" field:\'DoDate\'" width="100" align="center">Do Date</th>';
echo '<th data-options=" field:\'DoNumbering\'" width="300">Do Numbering</th>';
echo '<th data-options=" field:\'Received\'" width="60" align="center">Received</th>';
echo '<th data-options=" field:\'ProjectName\'" width="60" align="left">ProjectName</th>';
echo '<th data-options=" field:\'MaterialName\'" width="100" align="left">MaterialName</th>';

echo '</tr>';

echo
'    </thead>
</table>'
;

// search box

echo '
<div id="tb" style="padding:3px;  ">
    <Label for="MultipleDo">DO Number:</label>
    <input id="MultipleDo" name="MultipleDo" value="" style="line-height:18px; width:200px; margin:0 3px;">
<Label style="margin-left:10px;"for="Received">Received:</label>
<select id="Received" name="Received" >
  <option value="0">No</option>
  <option value="1">Yes</option>
  <option value="2">Both</option>
</select>
<a href="#" class="easyui-linkbutton" plain="true" onclick="doSearch()">Search</a>
</div>'
;


?>


<script type='text/javascript'>
function doSearch(){
$("table.easyui-datagrid").datagrid('load',{
"MultipleDo": $("#MultipleDo").val(),
"Received": $("#Received").val(),
"ProjectId": "<?php echo $_GET['ProjectId']; ?>",
"MaterialId": "<?php echo $_GET['MaterialId']; ?>",
}

);
console.log($('#MultipleDo').attr('id') +': '+ $('#MultipleDo').val());
console.log($('#tb').attr('id'));
}

</script>


and here is my last file for get.do.json.php
Code:


<?php
require_once("connectdb.php");


$MultipleDo = isset($_POST['MultipleDo']) ? mysql_real_escape_string($_POST['MultipleDo']) : '';
$Received = isset($_POST['Received']) ? mysql_real_escape_string($_POST['Received']) : '0';

$ProjectId = isset($_POST['ProjectId']) ? mysql_real_escape_string($_POST['ProjectId']) : '0';
$MaterialId = isset($_POST['MaterialId']) ? mysql_real_escape_string($_POST['MaterialId']) : '0';

if(
$Received == 2)
$Received '';

$page = isset($_POST['page']) ? (int)($_POST['page']) : 1;
$rows = isset($_POST['rows']) ? (int)($_POST['rows']) : 10;
$offset = ($page-1)*$rows;

$where " DoNumbering like '%$MultipleDo%' and Received like '%$Received%' ";

$sql "
SELECT
count(*) as total
FROM
do
INNER JOIN 
project ON do.projectid = project.projectid
INNER JOIN 
materialtype ON do.materialid = materialtype.materialid
WHERE "
.$where.
" AND
do.ProjectId = '
$_POST[ProjectId]
AND
do.MaterialId = 
$_POST[MaterialId]
"
;

if( 
$rs $mysqli->query($sql) )
$result $rs->fetch_assoc();

$sql "
SELECT
DoId,
DATE_FORMAT(DoDate, '%d/%m/%Y') as 'DoDate',

DoNumbering,
IF(Received = 0,'No','Yes') as Received, 
do.ProjectId,
project.ProjectName,
do.MaterialId,
materialtype.MaterialName
FROM
do
INNER JOIN 
project ON do.projectid = project.projectid
INNER JOIN 
materialtype ON do.materialid = materialtype.materialid
WHERE "
.$where.
" AND
do.ProjectId = '
$_POST[ProjectId]
AND
do.MaterialId = 
$_POST[MaterialId]
ORDER BY
DoDate DESC
LIMIT 
$offset$rows
"
;

if ( 
$rs $mysqli->query($sql) )
$result['rows'] = $rs->fetch_all(MYSQLI_ASSOC);


echo 
json_encode($result);
?>


10  General Category / EasyUI for jQuery / Re: tab scroller for easyui-tabs not appear on windows resize on: September 22, 2013, 05:46:32 PM
finally I have my issue solved.
The data grid need to call resize method.

Code:
    $(window).resize(function(){
$("div.easyui-tabs").each(function() {
if($(this).is(':visible'))
$(this).tabs('resize',{})
})

$('table.easyui-datagrid').datagrid('resize');



    });
11  General Category / EasyUI for jQuery / Re: tab scroller for easyui-tabs not appear on windows resize on: September 22, 2013, 01:45:33 AM
found the solution. But the datagrid still not resize as expected.
here is the code:

Code:
     $(window).resize(function(){
        $tabsp.tabs('resize',{});

$("div.easyui-tabs").each(function() {
if($(this).is(':visible'))
if($(this).attr('id') != 'tabsProject')
$(this).tabs('resize',{})
})


    });
12  General Category / EasyUI for jQuery / Re: tab scroller for easyui-tabs not appear on windows resize on: September 21, 2013, 08:33:05 PM
tried but not working.
look at resize.png, the red circle indicate the tabs-scroller left and right not appear until I perform a manual page refresh(F5).

i did tried:

Code:
    $(window).resize(function(){
        $(.tabsProject).tabs('resize',{});
    });
but it makes my datagrid appear at the bottom of my vertical tabs(bottom.png).



here is my whole code:

Code:
$(document).ready(function(){


$tabsp = $('#tabsProject');

var pselectedindex = -1;
var mselectedindex = -1;


    $(window).resize(function(){
        $tabsp.tabs('resize',{});
    });

title = $tabsp.tabs('getSelected').panel('options').title;

$tabsp.tabs({
onSelect: function(title, index){
if (pselectedindex != index)
{

var p = $tabsp.tabs('getSelected');  // get the selected tab panel
var  pid = p.panel('options').id.substr(4);
pselectedindex = index;
mselectedindex = -1;

$("div.easyui-tabs").each(function() {
if($(this).is(':visible'))
if($(this).attr('id') != 'tabsProject')
$(this).tabs({
onSelect: function(title, index){

if (mselectedindex != index){
var mp = $(this).tabs('getSelected');
var mid = mp.panel('options').id.substr(5);

mselectedindex = index;
mp.panel({
href:'load.do.grid.php?ProjectId='+ pid + '&MaterialId='+ mid

})
}
}
})




});

13  General Category / EasyUI for jQuery / Re: tab scroller not appear on windows resize on: September 21, 2013, 06:27:28 PM
sorry, i should explain more specific.
I enclosed image for reference.
I have 6 project name loaded as for each tab title. As i resize to smaller window size(enclosed image), the tab scroller never appear unless i refresh the windows.
14  General Category / EasyUI for jQuery / tab scroller for easyui-tabs not appear on windows resize on: September 21, 2013, 06:07:25 PM
Any way to allow tab scroller display after windows resize?
My experience was need to do page refresh which not what expected.
please advise
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!