I’ve a grid populate by sql_render and i can’t update fields (p1 p2 p3 p4 prom1 p5 p6 p7 p8 prom2 promfin)
table (without primary key, btw, i tried adding an auto_increment field but neither worked)
rut
nombre
idCurso
idAsignatura
Ano
p1
p2
p3
p4
Prom1
p5
p6
p7
p8
Prom2
PromFin
grid
//Grid
mateqGrid = layout.cells("a").attachGrid();
mateqGrid.setHeader("rut,idCurso,idAsignatura,Ano,p1,p2,p3,p4,Prom1,p5,p6,p7,p8,Prom2,PromFin");
mateqGrid.setInitWidths("100,100,100,50,50,50,50,50,60,50,50,50,50,60,60");
mateqGrid.setColAlign("left,left,left,left,left,left");
mateqGrid.setColTypes("ro,ro,ro,ro,ed,ed,ed,ed,ro,ed,ed,ed,ed,ro,ro");
mateqGrid.setColSorting("str,str,str,str,str,str");
mateqGrid.init();
mateqGrid.load("recursos/gridNotas.php?bdcol=<?php echo $_GET['bdcol'];?>&idCurso=<?php echo $_GET['idCurso'];?>&idAsignatura=<?php echo $_GET['idAsignatura'];?>");
//DataProcessor para Grid
var dpg = new dataProcessor ("recursos/gridNotas.php?bdcol=<?php echo $_GET['bdcol'];?>");
dpg.init(mateqGrid);
//Toolbar toolbar.xml
toolbar = layout.attachToolbar();
toolbar.setIconsPath("icons/");
toolbar.loadXML("recursos/toolbarsave.xml");
toolbar.attachEvent("onClick",function(id){
if(id=="saveProd"){
dpg.sendData();
};
});
gridNotas.php
require("../codebase/connector/grid_connector.php");
$res=mysql_connect("localhost","root","12345");
$bdcol=$_GET['bdcol'];
$idAsignatura=$_GET['idAsignatura'];
$idCurso=$_GET['idCurso'];
mysql_select_db($bdcol);
$gridConn = new GridConnector($res,"MySQL");
$gridConn->enable_log("gridNotas.log");
$gridConn->render_sql("SELECT * FROM notas WHERE idCurso='$idCurso' AND idAsignatura='$idAsignatura'","rut","rut,idCurso,idAsignatura,Ano,p1,p2,p3,p4,Prom1,p5,p6,p7,p8,Prom2,PromFin");
dataprocessor debug
Log:
row 165884094 marked [updated,valid]
Initiating data sending for 165884094
Initiating data sending for all rows
Sending all data at once
Server url: recursos/gridNotas.php?bdcol=col_colegio1&editing=true parameters
Server response received details
Action: updated SID:165884094 TID:165884094
row 165884094 unmarked [updated,valid]
row 165884094 marked [updated,valid]
Initiating data sending for 165884094
Initiating data sending for all rows
Sending all data at once
Server url: recursos/gridNotas.php?bdcol=col_colegio1&editing=true parameters
Server response received details
Action: updated SID:165884094 TID:165884094
row 165884094 unmarked [updated,valid]
row 165884094 marked [updated,valid]
Initiating data sending for 165884094
Initiating data sending for all rows
Sending all data at once
Server url: recursos/gridNotas.php?bdcol=col_colegio1&editing=true parameters
Server response received details
Action: updated SID:165884094 TID:165884094
row 165884094 unmarked [updated,valid]
Initiating data sending for all rows
gridNotas.log
====================================
DataProcessor object initialized
165884094_gr_id => 165884094
165884094_c0 => 165884094
165884094_c1 => 1
165884094_c2 => 1
165884094_c3 => 2012
165884094_c4 => 30
165884094_c5 => 20
165884094_c6 => 60
165884094_c7 =>
165884094_c8 =>
165884094_c9 =>
165884094_c10 =>
165884094_c11 =>
165884094_c12 =>
165884094_c13 =>
165884094_c14 =>
165884094_!nativeeditor_status => updated
ids => 165884094
Row data [165884094]
rut => 165884094
idCurso => 1
idAsignatura => 1
Ano => 2012
p1 => 30
p2 => 20
p3 => 60
p4 =>
Prom1 =>
p5 =>
p6 =>
p7 =>
p8 =>
Prom2 =>
PromFin =>
!nativeeditor_status => updated
UPDATE notas SET rut='165884094',idCurso='1',idAsignatura='1',Ano='2012',p1='30',p2='20',p3='60',p4='',Prom1='',p5='',p6='',p7='',p8='',Prom2='',PromFin='' WHERE rut='165884094' AND ( idCurso='' AND idAsignatura='')
Edit operation finished
0 => action:updated; sid:165884094; tid:165884094;
Done in 0.0432939529419s
how can i force the update?¿ i think “AND (idCurso=” AND idAsignatura=") is the problem