Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
beforeSubmit does not fire when I add a record
02/08/2012
20:53
Avatar
antonioberthely
New Member
Members
Forum Posts: 2
Member Since:
02/08/2012
sp_UserOfflineSmall Offline

Hi, when I add a new record beforeSubmit dont work. beforeSubmit  only works when I edit records. Please helpme.

here is:

    $("#list1").jqGrid({
        url:"/json.jsp?xaction=6&ejFiscal="+$("select[name=cmb_ejercicio]").val()+"&numOfc="+"ofc"+"&idTipo="+"1"+"&idModulo="+30,
        datatype: "json",
        colNames:['No. Oficio','Fecha de Oficio', 'Anexo', 'Nombre de quien firma', 'Cargo de quien firma','Nombre a quien se dirige','Cargo a quien se dirige','Observaciones'],
        colModel:[ {name:'noficio',index:'noficio', width:55, editable: true, editoptions:{size: 20}},
                    {name:'foficio',index:'foficio', width:90, editable: true,sorttype:'date',editoptions:{type: "date"},formatter:'date',formatoptions: {srcformat:'d/m/Y', newformat: 'd/m/Y'},
                                        editrules: {required:true, custom: true, custom_func:Validar}},
                    {name:'tanexo',index:'tanexo', width:100, editable: true, editoption:{size:50}},
                                        {name:'nfirma',index:'nfirma, invdate', width:100, editable: true, editoption:{size:50}},
                    {name:'cfirma',index:'cfirma', width:100, align:"right", editable: true, editoption:{size:50}},
                    {name:'ndirige',index:'ndirige', width:100, align:"right", editable: true, editoption:{size:50}},
                    {name:'cdirige',index:'cdirige', width:100,align:"right", editable: true, editoption:{size:50}},
                    {name:'obs',index:'obs', width:150, sortable:false, editable: true, edittype:"textarea", editoption:{rows:"2", cols:"10"}} ],
                                        

                rowNum:10,
        rowList:[10,20],
        pager: '#pager1',
        sortname: 'id',
        viewrecords: true,
        sortorder: "desc",
        editurl: "pages/fhpo/json.jsp?xaction=6&idModulo=30&idSegint=",
        caption:"Detalle" }).navGrid( '#pager1',
   {view:false,del:true,add:true,edit:true,refresh:true,search:false},
    {  
        beforeSubmit:function(postdata, formid) {
            postdata.obs=postdata.obs.replace(/\s*[\r\n][\r\n \t]*/g,"<br />");
            alert(postdata.obs+" "+postdata.file);
             return[true,""];
             }
        });

02/08/2012
20:55
Avatar
antonioberthely
New Member
Members
Forum Posts: 2
Member Since:
02/08/2012
sp_UserOfflineSmall Offline

antonioberthely said:

Hi, when I add a new record or delete record beforeSubmit dont work. beforeSubmit  only works when I edit records. Please helpme.

here is:

    $("#list1").jqGrid({
        url:"/json.jsp?xaction=6&ejFiscal="+$("select[name=cmb_ejercicio]").val()+"&numOfc="+"ofc"+"&idTipo="+"1"+"&idModulo="+30,
        datatype: "json",
        colNames:['No. Oficio','Fecha de Oficio', 'Anexo', 'Nombre de quien firma', 'Cargo de quien firma','Nombre a quien se dirige','Cargo a quien se dirige','Observaciones'],
        colModel:[ {name:'noficio',index:'noficio', width:55, editable: true, editoptions:{size: 20}},
                    {name:'foficio',index:'foficio', width:90, editable: true,sorttype:'date',editoptions:{type: "date"},formatter:'date',formatoptions: {srcformat:'d/m/Y', newformat: 'd/m/Y'},
                                        editrules: {required:true, custom: true, custom_func:Validar}},
                    {name:'tanexo',index:'tanexo', width:100, editable: true, editoption:{size:50}},
                                        {name:'nfirma',index:'nfirma, invdate', width:100, editable: true, editoption:{size:50}},
                    {name:'cfirma',index:'cfirma', width:100, align:"right", editable: true, editoption:{size:50}},
                    {name:'ndirige',index:'ndirige', width:100, align:"right", editable: true, editoption:{size:50}},
                    {name:'cdirige',index:'cdirige', width:100,align:"right", editable: true, editoption:{size:50}},
                    {name:'obs',index:'obs', width:150, sortable:false, editable: true, edittype:"textarea", editoption:{rows:"2", cols:"10"}} ],
                                        

                rowNum:10,
        rowList:[10,20],
        pager: '#pager1',
        sortname: 'id',
        viewrecords: true,
        sortorder: "desc",
        editurl: "pages/fhpo/json.jsp?xaction=6&idModulo=30&idSegint=",
        caption:"Detalle" }).navGrid( '#pager1',
   {view:false,del:true,add:true,edit:true,refresh:true,search:false},
    {  
        beforeSubmit:function(postdata, formid) {
            postdata.obs=postdata.obs.replace(/s*[rn][rn t]*/g,"<br />");
            alert(postdata.obs+" "+postdata.file);
             return[true,""];
             }
        });


07/08/2012
21:22
Avatar
JoeWhitlock
Member
Members
Forum Posts: 3
Member Since:
22/06/2012
sp_UserOfflineSmall Offline

Put your beforeSubmit in the add section.  I have one in the edit and the add sections. 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
34 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information