Forum
Topic RSS
16:41
Moderators
30/10/2007
OfflineHello,
Could you please look at demo page - section Row editing
Another possibility is to use custom formater
Regards
Tony
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.
17:03
Oh, I know demo page like my pocket. I read everything to learn tu use this great framework.
But this demo doesn't help as I'm trying to add a custom button (to add a duplicate fonction) in the edit form itself. Not in the grid. You know, before the "submit" button, I would like to have my custom button: duplicate.
17:09
Moderators
30/10/2007
OfflineHello,
Inline editing (as you say in first post) is diffrent from form editing.
You can use onInitializeForm event to add a custom button in the form something like:
onInitializeForm : function (formid)
{
$(”.EditButton”,formid).append(append here your button);
// bind click to the botton here
}
Regards
Tony
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.
18:14
It's almost ok !
Here's the code
var bC ="<input id=\\"cData\\" type=\\"button\\" value=\\"Copy\\"
onclick=\\"duplicateSample();\\"/>";
$(".EditButton",form_id).append(bC);
...
where duplicateSample() display only an alert('hello Tony');
The funny thing is my original submit and close button don't work anymore. I can saw them, but close doest close the form.
18:24
Moderators
30/10/2007
OfflineHello,
Give the button diffrent id as of cData - eg. ccData or something else
These cData, pData, nData, sData - are defined before in the form
Best Regards
Tony
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.
10:25
Many thanks again Tony for your help.
It's almost working. Here's the code.
{edit:true,add:true,del:true,search:false,refresh:true},
{
editCaption: “Edit Sample”,
(…)
},
onInitializeForm : function(form_id) {
var bC =”<input id=\\”ccData\\” class=\\”EditButton\\” type=\\”button\\” value=\\”copy\\” onclick=\\”duplicateSample()\\”>”
$(”.EditButton”,form_id).append(bC);
(…)
}
…
var idSample = jQuery(”#defineSample”).getGridParam('selrow');
var id = jQuery(”#defineSample”).getGridParam('selrow');
if (id) {
//on recupere les données de la ligne selectionnée
var idSample = $(”#defineSample”).getRowData(id);
$.ajax({
type: “POST”,
url: “include/ajax/smplDuplicate.php5?sampleId=”+id+”&requestId=”+document.getElementById('reqId').value,
data: “sampleId=”+id,
success: function(msg){
$(”#defineSample”).trigger(”reloadGrid”);
}
);//if id
} else {
errorMsg('Please, select a sample to duplicate first!');
}
}
There's still something wrong as it works on Firefox but not on IE.
I'm loosing Close and Submit actions on IE and the form doesn't open easily, as Firefox. Funny…
14:00
Moderators
30/10/2007
OfflineHello,
Try NOT TO ADD class EditButon for the input element. We already have it.
var bC =”<input id=\\”ccData\\” class=\\”EditButton\\” type=\\”button\\” value=\\”copy\\” onclick=\\”duplicateSample()\\”>”
$(”.EditButton”,form_id).append(bC);
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: 994
Currently Online:
43 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
Log In
Home
