JS GRID on Dynamic data
See original GitHub issueHELLO,I HAVE FETCHED THE DATA FROM DATABASE USING JAVA AND STORES IT ON JSON ARRAY .NOW I WANT SHOW THE DATA ON JSGRID TABLE PLEASE HELP ON THIS PROBLEM. THIS IS MY JSGRID CODE
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
filtering: true,
editing: true,
paging: true,
pageSize: 15,
pageButtonCount: 5,
fields: [
{ name: "Patient ID", type: "text", width: 150 },
{ name: "PatientName", type: "text", width: 150 },
{ name: "visitID", type: "text", width: 150 },
{ name: "Contact no", type: "text", width: 200 },
{ type: "kk" }
]
});
</script>
THIS IS MY BACKEND CODE
ResultSet rs = st.executeQuery(query);
while (rs.next()) {
JsonArray row = new JsonArray();
row.add(new JsonPrimitive(rs.getString("temp_patient_id")));
row.add(new JsonPrimitive(rs.getString("temp_patient_name")));
row.add(new JsonPrimitive(rs.getString("temp_gender_id")));
row.add(new JsonPrimitive(rs.getString("temp_mobile")));
data.add(row);
}
jsonResponse.add("ResponseData", data);
out.println(jsonResponse);
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Dynamic data import - Grid.js
Dynamic data import. The data attribute accepts a function as well: Live Editor. const grid = new Grid({ columns: ['Name', 'Email', ...
Read more >How to Convert a Static HTML Table to a Dynamic JavaScript ...
Load a list of Todo Items from a REST API and render in the table. Convert the HTML Table to a Data Grid...
Read more >JavaScript Dynamic Grid Lesson 4 Free Online Course ...
Dynamic JavaScript WebPages DOM CSSGrid Create Page ElementsGet the Course Free https://www.udemy.com/course/ javascript - grid /Course content ...
Read more >Create dynamic grid (row and col) for data coming from API call
I am completely new to React JS and JavaScript ...
Read more >Data grid with dynamic data - CodePen
A data grid connected to a dynamic remote endpoint, made with ZingGrid javascript library....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi Venkatramanaryams,
The data returned by your ajax call should either be in this format:
[{“Author”:“Gambardella, Matthew”,“Description”:“An in-depth look at creating applications with XML.”,“Genre”:“Computer”,“ID”:“bk101”,“PlotNo”:“101”,“Price”:44.95,“Title”:“XML Developer’s Guide”},{“Author”:“Ralls, Kim”,“Description”:“A former architect battles corporate zombies,\u000a an evil sorceress, and her own childhood to become queen\u000a of the world.”,“Genre”:“Fantasy”,“ID”:“bk102”,“PlotNo”:“102”,“Price”:5.95,“Title”:“Midnight Rain”}]
If there are any changes in the structure of the data returned by your ajax call, you can form it as object array as shown above on success of the ajax call.
Per the documentation, you need to provide a data property or controller object to JSGrid