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
addRowData adding blank rows
19/11/2012
01:01
Avatar
bocachai
New Member
Members
Forum Posts: 1
Member Since:
19/11/2012
sp_UserOfflineSmall Offline

Hi,

I have a grid that should be dinamically populated. The ajax ReferralPlansArray is returning the following array:

"[{PlanID:'50',Plan:'Initial Plan for Genius`s R` Us - Referral Type 1',Status:'A',Start:'',End:''}]"

and the jqGrid code is the follow. I'm not sure what I'm doing wrong but the code adds a blank row with no data on it. What am I missing?

Thanks in advance

jQuery(document).ready(function(){

.....

jQuery("#list4").jqGrid({
                datatype: "local",
                height: 100,
                colNames: ['PlanID', 'Plan', 'Status', 'Start', 'End'],
                colModel: [
                            { name: 'PlanID', index: 'PlanID', width: 30, sorttype: "int", hidden: true },
                               { name: 'Plan', index: 'Plan', width: 300, align: "left" },
                            { name: 'Status', index: 'Status', width: 50, align: "center" },
                            { name: 'Start', index: 'Start', width: 100, align: "left" },
                            { name: 'End', index: 'End', width: 100, align: "left" }
                        ],
                multiselect: false,
                caption: "Referral Plans",
                rowNum: 10,
                rowList: [10, 20, 30],
                pager: '#pager4',
                viewrecords: true,
                autowidth: true,
                onSelectRow: function (ids) {
                    var ret = jQuery("#list4″).jqGrid('getRowData', ids);
                    var _planID = ret.PlanID;
                    alert(_planID);

                } //end of onSelectRow
            }); //end of jQuery.jqGrid

            jQuery("#list4″).jqGrid('navGrid', '#pager4', { edit: false, add: false, del: false });

            var currentTime = new Date()
            var scurr = currentTime.getSeconds();
            scurr += "_";
            scurr += currentTime.getMinutes();
            $.ajax({
                url: "../Code/RequestHandler.ashx?ct=" + scurr + "&Command=ReferralPlansArray&AID=" + _activity,
                type: "GET",
                success: function (data, textStatus, XMLHttpRequest) {
                    $("#list4").jqGrid("clearGridData");
                    jQuery("#list4").jqGrid('addRowData', "PlanID", data);
                    $("#list4").trigger("reloadGrid");
                }
            }); //end of ajax
        }

....

 });     
Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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