Forum


10:24

18/09/2008

Hello. Great job here.
I'm sorry about my English
I'm starting to use jqGrid within a project and I'm having
some problems.
1. When I try to add the 'custom edit' column ,
only appear the title, there is no buttons. This make the
data columns move one step to left.
“Acciones” column should list the 'E', 'S', 'C' buttons,
like example here http://trirand.com/jqgrid/jqgrid.html,
but it don't do it.
2. It look like font does not read theme style.
this is my code:
HTML
….
<link rel=”stylesheet” type=”text/css” media=”screen” href=”images/themes/sand/grid.css” />
<script type=”text/javascript”
src=”javascript/jquery-1.2.6.js”></script>
<script type=”text/javascript”
src=”javascript/jqGrid/jquery.jqGrid.js”></script>
<script type=”text/javascript”
src=”javascript/jqModal.js”></script>
<script type=”text/javascript”
src=”javascript/jqGrid/js/jqDnR.js”></script>
….
<table id=”list” class=”scroll”></table>
<div id=”pager” class=”scroll” style=”text-align:center;”></div>
….
JS
jQuery(document).ready(function(){
jQuery(”#list”).jqGrid({
url:'services/service_bckusuarios.php',
datatype: 'xml',
mtype: 'POST',
colNames:['Acciones','Nombre Completo',
'Nombre de Usuario', 'E-mail','Ultimo Ingreso'],
colModel :[
{name:'actions', index:'actions',align:'left',sortable:false},
{name:'fullname', index:'fullname',align:'center',
editable:true},
{name:'username', index:'username',align:'center',
editable:true},
{name:'email', index:'email',align:'center',editable:true},
{name:'lastlog', index:'lastlog',align:'center',editable:false}],
pager: jQuery('#pager'),
rowNum:1,
rowList:[1,2,3],
sortname: 'nombre_completo',
sortorder: “asc”,
viewrecords: true,
imgpath: 'images/themes/sand/images',
caption: 'Usuarios de backend',
recordtext:'Usuarios en total',
loadui:'block',
loadComplete: function(){
var ids = jQuery(”#list”).getDataIDs();
for(var i=0;i<ids.length;i++){
var cl = ids[i];
be = “<input style='height:22px;width:20px;'
type='button' value='E'
onclick=jQuery('#list').editRow(”+cl+”); ></ids>”;
se = “<input style='height:22px;width:20px;'
type='button' value='S'
onclick=jQuery('#list').saveRow(”+cl+”); />”;
ce = “<input style='height:22px;width:20px;'
type='button' value='C'
onclick=jQuery('#list').restoreRow(”+cl+”); />”;
jQuery(”#list”).setRowData(ids[i],{act:be+se+ce})
}
},
editurl: 'services/service_bckusuarios.php'
}).navGrid('#pager',{refresh: true, edit: false, add: true, del: false, search: true});
});
Please give me a hand.
Thank you very much.
13:05

Moderators
30/10/2007

Hello,
jQuery(”#list”).setRowData(ids[i],{act:be+se+ce})
should be
jQuery(”#list”).setRowData(ids[i],{actions:be+se+ce})
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
16:50

18/09/2008

Hello.
i did the correction and the buttons appear. But i'm still losing
one column, the first one.
Any idea?
this is the php code:
echo "<?xml version='1.0' encoding='utf-8'?>";
echo "<rows>";
echo "<page>".$page."</page>";
echo "<total>".$total_pages."</total>";
echo "<records>".$count."</records>";
// be sure to put text data in CDATA
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
if($row['logingreso']!=0){ $logingreso= date('Y/m/d - H:i:s', $row['logingreso']);} else{$logingreso='x';}
echo "<row id='". $row[idbkend_users]."'>";
echo "<cell>". utf8_encode($row['nombre_completo'])."</cell>";
echo "<cell>". utf8_encode($row['username'])."</cell>";
echo "<cell>". $row['email']."</cell>";
echo "<cell>".$logingreso ."</cell>";
echo "</row>";
}
echo "</rows>";
05:25

Moderators
30/10/2007

Hello,
Add additinal empty cell to the response:
echo “<row id='”. $row[idbkend_users].”'>”;
echo “<cell></cell>”;
echo “<cell>”. utf8_encode($row['nombre_completo']).”</cell>”;
echo “<cell>”. utf8_encode($row['username']).”</cell>”;
echo “<cell>”. $row['email'].”</cell>”;
echo “<cell>”.$logingreso .”</cell>”;
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
74 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66