Sry for my late response :s
I don't like label for columns key, it could brake or degrade (it may be french words ^^”) the application.
For example, my colmodel definition :
1 colNames:["Indicateur de d
Hello,
Sometimes you need to search 🙂
Two ways :
Hello yacahuma,
Today, in a Jqgrid, you've got on row for each table record. Each table column could be Grid cell.
The datatype of each cell can be customized with formatter or directly when the data are getted from your database.
You can save your data before save them into database.
But what you're talking is each row / cells correspond to only one table row formatted into XML, i'm right ?
You can do this in two ways :
Hello 😉
I done this :
“
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 ,gridComplete: function(){<br /><br /><br />var re = ''<br />var ad = ''<br />var du = ''<br />var ed = ''<br />var de = ''<br /><br />var ids = jQuery("#service_table").jqGrid("getDataIDs");<br />for(var i=0;i < ids.length;i++)<br />{<br />var cl = ids<i>;<br /><br /><br />re = "<div class="'ui-pg-div'"><span class="'ui-icon" title="'Consulter'"></span></div>";<br />ad = "<div class="'ui-pg-div'"><span class="'ui-icon" title="'Ajouter'"></span></div>";<br />du = "<div class="'ui-pg-div'"><span class="'ui-icon" title="'Dupliquer'"></span></div>";<br />ed = "<div class="'ui-pg-div'"><span class="'ui-icon" title="'Modifier'"></span></div>";<br />de = "<div class="'ui-pg-div'"><span class="'ui-icon" title="'Supprimer'"></span></div>";<br />jQuery("#service_table").jqGrid("setRowData",cl,{grid_actions:re + ad + du + ed + de});<br />}<br /><br />}"<br /><br />"<br /><pre id="line118">function GetserviceForm(method, gridId, formId, rowID){<br />// les donnees pour valider le form : precedes de frm_ car le isValid prend les id des elements du form<br />// on precede de l id du form car IE ne retrouve pas<br />$data = "method="+method+"&id_Prestation="+rowID+"&format=html";<br />var ts = $(gridId + ".ui-jqgrid-btable").get(0);<br />if(ts.grid.hDiv.loading){<br />return;<br />}<br />beginGridRequest(gridId);<br />$.ajax({<br />type: "POST",<br />url:baseUrl + "/index.php/manage_service-getform",<br />async:true,<br />data: $data,<br />success: function(reponse){<br />if(reponse != null && reponse != ""){<br />$(formId).empty();<br />$(formId).append(reponse);<br />/*$(formId).get(0).innerHTML = reponse;*/<br />}else{<br />$(formId).empty();<br />}<br />var labelForm = titleRead;<br /><br /><br />if(method == "edit"){<br />labelForm = titleEdit;<br />}else if(method == "add"){<br />labelForm = titleAdd;<br />}else if(method == "duplicate"){<br />labelForm = titleDuplicate;<br />}<br />endGridRequest(gridId);<br />$(formId)<br />.dialog({bgiframe: true,<br />modal: true,<br />autoOpen: false,<br />height: 250,<br />width: 350,<br />buttons: {Annuler: function() {<br />$("#service_form_div_").dialog("close");<br />},<br />Valider: function() {<br />SubmitserviceForm("#service_table", "#service_form_div_");<br />}}})<br />.dialog({ title: labelForm })<br />.dialog("open");<br /><br /><br />},<br />error: function(reponse, textStatus, errorThrown){<br />endGridRequest(gridId);<br />alert("Execution error");<br />}<br />});<br />}; // Fin CloseForm()<br />function SubmitserviceForm(gridId, formId){<br />$data ="id_Prestation="+$(formId + "id_Prestation").val()+"&libelle="+$(formId + "libelle").val()+"&grid_actions="+$(formId + "grid_actions").val()+"&";<br />var ts = $(gridId + ".ui-jqgrid-btable").get(0);<br />if(ts.grid.hDiv.loading){<br />return;<br />}<br /><br /><br />beginGridRequest(gridId);<br />$.ajax({<br />type: "POST",<br />url:baseUrl + "/index.php/manage_service-check?format=html",<br />async:true,<br />data: $data,<br />success: function(reponse){<br />endGridRequest(gridId);<br />if(reponse != null && reponse != ""){<br />// echec on affiche la reponse, qui et le zend_form avec erreurs<br />$(formId).get(0).innerHTML= $(reponse).get(0).innerHTML;<br />}else{<br />// succes, rechargement du jqgrid et fermeture dialog avec zend_form<br />jQuery(gridId).trigger("reloadGrid");<br />$(formId).dialog("close");<br />}<br />},<br />error: function(reponse, textStatus, errorThrown){<br />endGridRequest(gridId);<br />alert("Execution error");<br />}<br />});<br />}; // Fin SubmitForm()<br /><br /><br />/**<br />* Supprime une ligne du tableau<br />*/<br />function DeleteserviceRow(gridId, rowID){<br />var ts = $(gridId + ".ui-jqgrid-btable").get(0);<br />if(ts.grid.hDiv.loading){<br />return;<br />}<br />jQuery(gridId).setSelection(rowID, false);<br />if (confirm(msgConfirmSupp)) {<br />beginGridRequest(gridId);<br />$.ajax({<br />type: "POST",<br />url: baseUrl + "/index.php/manage_service-delete-"+rowID,<br />dataType:"html",<br />data:"format=html",<br />success: function(reponse){<br />endGridRequest(gridId);<br />if(reponse == ""){<br />jQuery(gridId).delRowData(rowID);<br />}else{<br />alert("Suppression impossible :n" + reponse);<br />}<br />},<br />error: function(reponse, textStatus, errorThrown){<br />endGridRequest(gridId);<br />alert("Execution error");<br />}<br />});<br />} else {<br />jQuery(gridId).resetSelection();<br />} // if<br />}; // fin DeleteRow<br />"<br /><br />It's not perfect (I'll make refactorisation of this code) but it work perfectly :) (I don't like default form edition)<br /><br />Hope this help you
Hmmmm,
I'm using Javascript Grid and developped custom PHP Grid than i think than i could help you 🙂
I suppose than you error is a javascript error.
Well,
Remove this part opf your code :
,
Hello handelcamilo,
In my mind, colmodel names must to be code and not label, without special characters etc.
The internal code and the label are two differents things. It's a non sense (in french ?) to do what you do…..
If you use internal code (and not label/title) you'll not have this kind of problem 🙂
In my mind it's the best best best best solution 😉
PS : you've got colNames for names, after each colModel will have their name defined in order of defined colName
Hello,
Are you talking about Form function ?
In this case you could use Jquery maskedinput plugin, see at :
Hello ![]()
I think than you're talking about this plugin :
http://plugins.jquery.com/proj…..QGridState
I don't think than this Plugin is really supported by Tony (JqGrid). Columns metadata are correctly stored.
I think than new JqGrid works for other parameters differently and the Plugin JqGridState has not been released since July 2010.
Two ways :
Hello tony and sorry for mistake.
We can consider this topic closed 🙂 and thank to you for this great grid 😉
I tried beforeRequest with boolean tag (firstLoad).
if it's the first load, it call function described in next thread without reload grid.
The problem is no parameters has been setted in that case :s
Any suggestion ? ^^
Thank for your response OlegK,
But i made some test comparisons between jqgrid searchFilter (1.2.9 for jqgrid 3.6.5 and … 1.2.9 for jqgrid 3.6.5 with some differences) and i found my problem :
jquery function(event){event.stopPropagation();}
This function removed from the jqgrid code allow my code to work fine. I think in that case than in any case, event propagation is necessary (??) for IE8 (??) but i don't know why :D.
Juste change this code :
jQ.find(".ui-add").click(function(e) {
Hello OlegK
1/ No, it's really display an additional message in case of successful add/edit operation. My code :
/**
Thank you OlegK for your response 🙂
I'll respon to yours suggestions :
1/ I use afterSubmit for error message. But if succeed, the process continue and no action seems to be possible :s
2/ I use the dataEvents change for user interraction. It's good for this part, but the initialisation……. (edit or add) no :s. For the second part, Tony wrote “initialid” but don't explain where the value is initialised. In fact, the field where my list is linked is not the id but an other field. Is it possible ?
3/ The third point is in case of the second point is not resolved, thank for the link 😉
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top