I am not able to understand the following code? can you please explain in detail?
I am not able to understand the following code? can you please explain in detail?
praphulla
Posts: 13Questions: 5Answers: 0
After retriving the response we write :
var api = this.api();
api.rows( {page:'current'} ).data();
&
api.rows( {page:'current'} ).nodes();
Actually I have retrived the JSONObject like:
{
"rows": [{
"ID": "0530201723001738",
"NAME": "ABC"
"CLG": "IIT",
}, {
"ID": "5640201723001738",
"NAME": "JHON"
"CLG": "IIM",
}
}
How the api works and and how it diffrentiate between:
api.rows( {page:'current'} ).data();
&
api.rows( {page:'current'} ).nodes();
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The
rows()
method will select the rows based on the selector you give it (in this case it is selected the rows based on the current page). That stores information in the API instance which allows it to then chain on additional methods -rows().data()
for example. There are other methods such asrows().every()
androws().indexes()
as well which can also be used.Allan
Hi I have different JSON objects inside the rows and I have used the selector {page:'current'} how this selector works and when it comes in picture and you wrote that
(in this case it is selected the rows based on the current page) what is current page term im not getting.
This is the code for how it works.
If it isn't working for you, please link to a test case showing the issue so it can be debugged.
Allan
I didn't understood whole code but little bit I understood.Thanks