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_TopicIcon
Grid Master Detail
29/07/2010
22:24
Avatar
onaiggac
Member
Members
Forum Posts: 28
Member Since:
23/07/2010
sp_UserOfflineSmall Offline

Hi,

Im using the Master Detail grid to add/update data in my database.

The first Grid (Categories) is working fine (add/update). When I select an item, the second Grid (Labels) are populed and I can edit, so far so good. But I cant add an item whitout the Categories ID.

How can I send the Categories ID in the add submit method of Labels Grid?

Ps.: I receiving this data when do the submit in Labels: title=test&oper=add&id=_empty

And I want to receive this way: id_cat=3&nome=teste&oper=add&id=_empty

Tks

29/07/2010
22:39
Avatar
srikant
Member
Members
Forum Posts: 3
Member Since:
29/07/2010
sp_UserOfflineSmall Offline

Can you share the code of working grids in your case with code,..

I mean how you setup first

What version u installed? etc

29/07/2010
22:58
Avatar
onaiggac
Member
Members
Forum Posts: 28
Member Since:
23/07/2010
sp_UserOfflineSmall Offline

Version: 3.7.2

Categories:

jQuery("#categoria").jqGrid({

url: 'categoria_listar.asp',

datatype: "xml",

colNames: ['Título'],

colModel: [

{ name: 'nome', width: 520, editable: true, edittype: 'text', editrules: { required: true }, editoptions: { size: 37, maxlength: 50 }, sortable: false }

],

rowNum: 10,

rowList: [10, 20, 30],

pager: '#pager_categoria',

sortname: 'id',

viewrecords: true,

sortorder: "desc",

multiselect: false,

caption: "Categorias",

id: "asin",

editurl: "categoria_add_alt.asp",

pgtext: "Página {0} de {1}",

emptyrecords: "Sem registro",

loadtext: "Carregando…",

recordtext: "Ver {0} – {1} de {2}",

onSelectRow: function(ids) {

if (ids == null) {

ids = 0;

if (jQuery("#rotulo").jqGrid('getGridParam', 'records') > 0) {

jQuery("#rotulo").jqGrid('setGridParam', { url: "rotulo_listar.asp?id=" + ids, page: 1 });

jQuery("#rotulo").jqGrid('setCaption', "Rótulos")

.trigger('reloadGrid');

}

} else {

jQuery("#rotulo").jqGrid('setGridParam', { url: "rotulo_listar.asp?id=" + ids, page: 1 });

jQuery("#rotulo").jqGrid('setCaption', "Rótulos")

.trigger('reloadGrid');

}

jQuery("#pager_rotulo").css("display", "block");

}

});

jQuery("#categoria").jqGrid('navGrid', '#pager_categoria', { add: true, edit: true, del: true, search: false, refresh: false });

Labels:

jQuery("#pager_rotulo").css("display","none");

jQuery("#rotulo").jqGrid({

url: 'rotulo_listar.asp',

datatype: "xml",

colNames: ['ID Cat.', 'Título'],

colModel: [

{ name: 'id_cat', width: 20, editable: false, sortable: false, hidden: true, editable: true, editoptions: { value: jQuery("#categoria").jqGrid('getGridParam', 'selrow')} },

{ name: 'nome', width: 520, editable: true, edittype: 'text', editrules: { required: true, custom: true, custom_func: checarCampo }, editoptions: { size: 37, maxlength: 50 }, sortable: false }

],

rowNum: 5,

rowList: [5, 10, 20],

pager: '#pager_rotulo',

sortname: 'id',

viewrecords: true,

sortorder: "desc",

multiselect: false,

caption: "Rótulos",

id: "asin",

editurl: "rotulo_add_alt.asp",

pgtext: "Página {0} de {1}",

emptyrecords: "Sem registro",

loadtext: "Carregando…",

recordtext: "Ver {0} – {1} de {2}",

edit: {

onclickSubmit: function(params, postdata) {

alert(params);

}

}

}).navGrid('#pager_rotulo', { add: true, edit: true, del: false, search: false, refresh: false });

These bold codes dont work.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
59 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