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
How to use the tableToGrid?
21/12/2010
11:33
Avatar
nanlinfeixue
Member
Members
Forum Posts: 7
Member Since:
28/05/2010
sp_UserOfflineSmall Offline

<table id="mytable">
  <tr>
     <th>Id</th>
     <th>Name</th>
     <th>Age</th>
     <th>Reamrk</th>
  </tr>
  <tbody>
    <tr>
      <td>1</td>
      <td>name1</td>
      <td>1</td>
      <td>Remark1</td>
    </tr>
   <tr>
      <td>2</td>
      <td>name1</td>
      <td>1</td>
      <td>Remark1</td>
    </tr> 
     </tbody>
<table>

 <div id="pager"></div>

<script>
 $(function () {
  tableToGrid("#mytable", {
   autowidth:true,
   pager: '#pager',
   rowNum: 20,
   viewrecords: true,
   loadui: true,
   rowList: [10,20,50]
  });
 });
</script>

I get the error message: 'b.jgrid.formatter.integer' Is null or not an object

Is any one help me?

thanksLaugh

21/12/2010
20:07
Avatar
mrh
Member
Members
Forum Posts: 3
Member Since:
21/12/2010
sp_UserOfflineSmall Offline

You did not post the rest of your code but your table and JS code work fine.  You didn't show how you are linking to the jqgrid code or CSS.  Also you have errors in your HTML like <table> instead of </table> and having a <tbody> without a <thead> etc...

Here is my full code.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DT.....t;&gt;
<html xmlns="http://www.w3.org/1999/xhtml&q.....t;&gt;
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Table To Grid Test</title>
<link rel="stylesheet" type="text/css" media="screen" href="js/grid/css/ui-lightness/jquery-ui-1.8.7.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="js/grid/css/ui.jqgrid.css" />
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript" src="jqgrid/js/i18n/grid.locale-en.js"></script>
<script type="text/javascript" src="jqgrid/js/jquery.jqGrid.min.js"></script>
<script type="text/javascript" src="jqgrid/js/jquery-ui-1.8.7.custom.min.js"></script>
<script type="text/javascript">
$(function () {
    tableToGrid("#mytable", {
        autowidth:true,
        pager: '#pager',
        rowNum: 20,
        viewrecords: true,
        loadui: true,
        rowList: [10,20,50]
    });
});
</script>
</head>
<body>
<table id="mytable">
  <thead>
    <tr>
      <th>Id</th>
      <th>Name</th>
      <th>Age</th>
      <th>Reamrk</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>1</td>
      <td>name1</td>
      <td>1</td>
      <td>Remark1</td>
    </tr>
    <tr>
      <td>2</td>
      <td>name1</td>
      <td>1</td>
      <td>Remark1</td>
    </tr>
  </tbody>
</table>
<div id="pager"></div>
</body>
</html>
Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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