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
.jqGrid('getGridParam', 'selrow') return Undefined :(
14/07/2011
20:00
Avatar
CaraK
Member
Members
Forum Posts: 10
Member Since:
14/07/2011
sp_UserOfflineSmall Offline

Hi

I try to do a simple grid but when I select a row this alert return UNDEFINED my code is:

<script type="text/javascript">
        $(document).ready(function() {
            jQuery("#grillausers").jqGrid({
                url: 'FetchDatos.aspx',
                datatype: 'json',
                colNames: ['ID', 'Nombre', 'Activo', 'Sexo'],
                colModel: [
                { name: 'Id', index: 'Id', width: 20, editable: false, editoptions: { readonly: true, size: 5} },
                { name: 'Nombre', index: 'Nombre', width: 250, align: "left", editable: true, size: 100 },
                { name: 'IsClosed', index: 'IsClosed', width: 200, align: 'left', editable: true, edittype: "checkbox", editoptions: { value: "Activo:Inactivo", formatter: "checkbox"} },
                { name: 'Gender', index: 'Gender', width: 200, formatter: 'select', editable: true, edittype: "select", editoptions: { value: "0:select;1:Masculino;2:Femenino"} }
            ],
                rowNum: 10,
                rowList: [5, 10, 15, 20],
                pager: '#paginaciongrilla',
                sortname: 'Id',
                viewrecords: true,
                sortorder: "desc",
                jsonReader: {
                    repeatitems: false
                },
                caption: 'Usuarios',
                height: '100%',
                editurl: 'FetchDatos.aspx'
            });
            jQuery("#grillausers").jqGrid('navGrid', '#paginaciongrilla', { edit: false, add: false, del: false, search: false });

            jQuery("#a1").click(function() {
            var id = jQuery("#paginaciongrilla").jqGrid('getGridParam', 'selrow');
alert(id);
                if (id) {
                                    var ret = jQuery("#paginaciongrilla").jqGrid('getRowData', id);
                                        alert("id=" + ret.id + "!");
                } else {
                    alert("No tomo nada...");
                }
            });

            // Accordion
            $("#accordion").accordion({ header: "h3" });

            // Tabs
            $('#tabs').tabs();

        });
        </script>

Im usign jquery.jqGrid-4.1.1 and .Net Page.Master

Please Help, I really need this 😛

14/07/2011
20:05
Avatar
CaraK
Member
Members
Forum Posts: 10
Member Since:
14/07/2011
sp_UserOfflineSmall Offline

Jejejeje Im sorry I was refering the wrong Id for the onclick

var id = jQuery("#paginaciongrilla").jqGrid('getGridParam', 'selrow');

the good string is:

var id = jQuery("#grillausers").jqGrid('getGridParam', 'selrow');

Thanks and great forum 😉

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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