ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
USE api model function has error
Title:
B
I
{code}
?
I want get select row data follow you get me sample const grid_1 = $('#editFMD164a2aD164a2bGrid'); grid_1.on('click', '.awe-row', function () { var model = grid_1.data('api').model(this); alert(model); console.log(model); }); but show js error ver 8.0.7.0 AwesomeMvc.js:1 Uncaught TypeError: n.data is not a function at h.model (AwesomeMvc.js:1:39491) at HTMLTableRowElement.<anonymous> (<anonymous>:41:44) at HTMLDivElement.dispatch (jquery-3.5.1.js:5429:27) at elemData.handle (jquery-3.5.1.js:5233:28) h.model @ AwesomeMvc.js:1 (anonymous) @ VM993:41 dispatch @ jquery-3.5.1.js:5429 elemData.handle @ jquery-3.5.1.js:5233
Save Changes
Cancel
RayBen
asked 23 days ago
Answers
B
I
{code}
?
First make sure the grid is selected correctly, Try console.log(grid_1.length)
Save Changes
Cancel
Omu
answered 23 days ago
console.log(grid_1) console.log(grid_1.length) VM228:43 jQuery {0: div#editFMD164a2aD164a2bGrid.awe-grid.awe-hh, length: 1} VM228:44 1
23 days ago
RayBen
if after this `grid_1.data('api')` throws an error, try this: https://www.aspnetawesome.com/learn/mvc/CommonProblems#Isolate-the-problem
23 days ago
Omu
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK