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
Issue with scoll: 1
13/01/2011
18:33
Avatar
elitemike
Member
Members
Forum Posts: 3
Member Since:
13/01/2011
sp_UserOfflineSmall Offline

Hello all, I hope someone can help me.  I have a grid with scroll set to 1 for endless scroll.  occasionally it's making one final call to the webservice to grab the same final rows.  When regular paging is used, this does not happen.  After debugging, it is indeed making the same exact final call 2 times and appending those results.  My code is below.  Currently there is no sorting implemented.

I am wondering why there is no code snippet option on this forum.

Javascript

function InitializeJQGridEP()
 {
     var AuthID = "";
     if (CurrentAuthorized != null)
         AuthID = CurrentAuthorized.ID;
     $("#EPTable").jqGrid({
         datatype: 'json',
         url: URL,
         postData: { AuthorizedID: AuthID },
         mtype: 'GET',
         colNames: ['Item', 'Permission', 'Authorization', 'Set On', ''],
         colModel: [
                        { name: 'SecurableName', index: 'SecurableName' },
                        { name: 'PermissionName', index: 'PermissionName', width: 220 },
                        { name: 'Authorization', index: 'Authorization', classes: 'epAuthorization' },
                        { name: 'AuthorizedName', index: 'AuthorizedName', Width: 260 },
                        { name: 'AuthorizedID', index: 'AuthorizedID', width: 15, classes: 'EP_Goto' }
                          ],
         jsonReader:
                    {
                        root: function (obj) { return obj.d.rows; },
                        total: function (obj) { return obj.d.total; },
                        page: function (obj) { return obj.d.page; },
                        records: function (obj) { return obj.d.records; }
                    },
         rowNum: 12,
         scroll: 1,
         gridview: true,
         pager: '#EPPager',
         viewrecords: true,
         recordtext: "{2} Effective Permissions",
         loadtext: "Retrieving Effective Permissions..",
         emptyrecords: "No Effective Permissions!",
         sortname: 'SecurableName',
         sortorder: "asc",
         width: Width,
         height: Height,
         onSelectRow: EPRowSelected,
         loadui: 'block',
         altRows: true,
         altclass: "alt",
         gridComplete: EPGridComplete
     });

     $("#EPTable").jqGrid('navGrid', '#EPPager',
            { edit: false, add: false, del: false, refresh: false },
            {},
            {},
            {},
            { closeOnEscape: true, multipleSearch: false, closeAfterSearch: true });
 }

Webservice

        public jqGrid GetEffectivePermissions(int? page, int? rows, string sidx, string sord, bool? _search, string searchField, string searchString, string searchOper, string AuthorizedID)
        {
            string sortExpression = string.Format("{0} {1}", sidx, sord);
            List<ISecurableAuthorization> permissions = new List<ISecurableAuthorization>(); ;
            int TotalEntries=0;
            if (string.IsNullOrEmpty(AuthorizedID))
            {           
                TotalEntries = permissions.Count;
            }
            else
            {
                try
                {
                    Guid AuthID = new Guid(AuthorizedID);
                    permissions = sm.GetEffectivePermissions(AuthID, rows.Value, page.Value, out TotalEntries);
                }
                catch (Exception e)
                {

                }
            }

            jqGrid g = new jqGrid();
            g.total = Convert.ToString(Math.Ceiling(TotalEntries / Convert.ToDouble(rows.Value)));
            g.page = Convert.ToString(page.Value);
            g.records = TotalEntries.ToString();

            int Counter = 0;
            foreach (ISecurableAuthorization auth in permissions)
            {
                Counter++;
                jqGridRowElement row = new jqGridRowElement();
                row.id = Counter.ToString();
                row.cell.Add(auth.SecurableName);
                row.cell.Add(auth.PermissionName);
                AuthorizationType authType = (AuthorizationType)auth.AuthorizationBits;
                row.cell.Add(authType.ToString());
                row.cell.Add(auth.AuthorizedName);
                row.cell.Add(auth.AuthorizedID.ToString());

                g.rows.Add(row);
            }
            return g;
        }

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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.com

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information