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
Uncaught TypeError: Property 'formatter' of object # is not a function
23/05/2013
12:40
Avatar
Mars1112
philippines
New Member
Members
Forum Posts: 1
Member Since:
23/05/2013
sp_UserOfflineSmall Offline

Hello,

I have issue on GridUnload function.

Here's the scenario. 

On the UI i have the following:

- Search InputBox 

- Search Button

- JQGrid

- Add new record  button

Upon load of the page. When I input a value on the inputbox then hit search button, it calls the below function (initGrids(material)).

The page was able to display successfully the grid with the corresponding records.

And also able to add new row when i click on the Add new record button with an ID "addRow".

When i try to input different value in the inputbox then hit search. the Grid successfully refresh and display the different records.

But the problem is when try to click on the new record button is shows an error exception which the

Uncaught TypeError: Property 'formatter' of object #<HTMLTableElement> is not a function

(anonymous function)jquery.jqGrid.src.js:3211

 st.extend.eachjquery-1.9.0.min.js:1

st.fn.st.eachjquery-1.9.0.min.js:1

$.jgrid.extend.addRowDatajquery.jqGrid.src.js:3162

$.fn.jqGridjquery.jqGrid.src.js:747

(anonymous function)ibr.js:859

st.event.dispatchjquery-1.9.0.min.js:2

y.handle

My assumption is the error cause by GridUnload function. Dut that when i'm using the refresh or "reloadgrid" function it works fine and able to add new record.

Any Idea on the error and i can resolve it?

function initGrids(material) {

$("#grid1").GridUnload();

JQuery("#grid1").jqGrid({

url:'getJqGridPage.json',

postData:{material:material, grid:'grid1'},

datatype: "json",

colNames:['','column1', 'column2', 'column3', 'column4', 'column5'],

colModel:[{name: 'mGear', index: 'mGear', formatter: imageFormat},

{name: 'column1', index: 'column1'},

{name: 'column2', index: 'column2', editable: true, edittype:'text'},

{name: 'column3', index: 'column3'},

{name: 'column4', index: 'column4'},

{name: 'column5', index: 'column5', editable: true, edittype:'text'}],

mtype: 'GET',

jsonReader : {

root: "rows",

page: "page",

total: "total",

records: "records",

repeatitems: false,

reload: true,

cell: "cell",

id: "id"

},

sortname: 'id',

pager: '#grid1pager',

multiselect: false,

sortorder: 'desc',

viewrecords: true,

caption: 'Sample Grid',

loadComplete: function(){

$('#addRow').click( function(){

var newRowData = {column1:"1", column2:"", column3:"", column4:"", column5:""},

      newRowId = $.jgrid.randId(),

      myGrid = $(this);

myGrid.jqGrid('addRowData', newRowId, newRowData);

myGrid.jqGrid('setSelection', newRowId);  // select new row

myGrid.jqGrid('editRow', newRowId, true); // editing the row

  }

  }

  });

}

I really appreciate your help.

Thanks and Regards,

Mars1112

12/08/2013
12:40
Avatar
njshaw2
UK
New Member
Members
Forum Posts: 1
Member Since:
12/08/2013
sp_UserOfflineSmall Offline

I get a very similar problem.  Using jGrid 4.5.2, if I call GridUnload(), or jqgrid("GridUnload") on my table, JavaScript just bottoms out of the function immediately.  If I put the call in a try/catch clause, the exception error is undefined.  The table is not wiped at all.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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