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
Error jqGrid in asp.net mvc
30/07/2009
06:27
Avatar
sanfra
Guest
Guests

Good Morning at all, I'am a italian boy,

sorry for my English but I need your help to implement the jqGrid in a project.
I saw that the jqGrid will not work if applied to a different location to / View / Home / Action.
Someone can help me solve this problem.

I do like this, I put the files on the MasterPage: 
 

<link href="../../Content/jqGridCss/ui.jqgrid.css" rel="stylesheet" type="text/css" />

     src="../../Scripts/jquery-1.3.2.js" <script type="text/javascript"> </ script>
     src="../Scripts/jquery.jqGrid.js" <script type="text/javascript"> </ script>

     src="../../Scripts/jqGridJs/jqModal.js" <script type="text/javascript"> </ script>
     src="../../Scripts/jqGridJs/jqDnR.js" <script type="text/javascript"> </ script>

and on the pages that I view the server jqGrid
I put this:

  <script type="text/javascript">
         jQuery (document). ready (function () (
           
                 jQuery ( "# list"). jqGrid ((
                     url: '/ Log / LinqGridData',
                     datatype: 'json',
                     mtype: 'GET',
                     colNames: [ 'IdLog', 'Username', 'Date'],
                     colModel: [
           (Name: 'IdLog', index: 'IdLog', width: 40, align: 'left'),
           (Name: 'Username', index: 'Username', width: 40, align: 'left'),
           (Name: 'Date', index: 'Date', width: 400, align: 'left')],
                     pager: jQuery ( '# pager'),
                     rownum: 10
                     rowList: [5, 10, 20, 50],
                     sortname: 'IdLog',
                     sortorder: "desc",
                     viewrecords: true,
                     height:'100% ',
                     width:'100% ',

                     caption: 'My first grid'
                 ));
            
         ));
     </ script>

</ asp: Content>
<asp:Content ContentPlaceHolderID="MainContent" runat="server">
     <h2>
         My Grid Data </ h2>
     <table id="list" cellpadding="0" cellspacing="0">
     </ table>
     <div id="pager" style="text-align: center;">
     </ div>

LogController the file I put this: 
  

[Authorize (Roles = "admin")]
         public ActionResult LinqGridData (string sidx, sord string, int page, int rows)
         (
             LogRepository lr = new LogRepository ();
           

             var movieList = lr.VisualizzaLog ();

             int totalRecords = movieList.Count ();
             totalPages int = (int) Math.Ceiling ((float) totalRecords / (float) rows);

             var = new jsonData
             (

                 total = totalPages,
                 page = page,
                 records = totalRecords,
                 rows = (
                     from m in movieList
                     select new
                     (
                         i = m.IdLog,
                         cell = new string [] (
                         m.Username.ToString (), m.Data.ToString ()
                         )
                     )
                 ). ToArray ()
             );
             return JSON (jsonData);
         )

          the problem is that I do not see the fields and ie all the parameters are invalid.

someone can give me some help?
I despair! Cry
Thank you
30/07/2009
08:04
Avatar
sanfra
Guest
Guests

There isn't anyone that help me?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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