Skip to main content

dojo.table load data

4 replies [Last post]
jomello_br
Offline
Joined: 2004-04-27

Friends,

Somebody has some example of the component jMaki->dojo.table, carrying data of the database?

Sorry my english :-( I not speak english I used translator :-)

byee

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jomello_br
Offline
Joined: 2004-04-27

hi gmurray71 again :-)

I am making small changes in the dojo.table and as soon as has something ready I enter in contact.

I title fixed in the screen

Scroll in the table

I use of direction keys

Updating of fields input in the navigation of the grid

Hugs

jomello_br
Offline
Joined: 2004-04-27

Thanks gmurray71 very very good :D

Only one more question:

Does he/she/you have as doing pagination of the data?

thanks and hugss :-)

Example in servlet:

[b]Code JSP:[/b]

[b]Code Servlet: [/b]

protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=ISO-8859-1");

PrintWriter out = response.getWriter();

out.println("{");
out.println("'columns': { 'title' : 'Title', 'author':'Author', 'isbn': 'ISBN #', 'description':'Description'},");
out.println("'rows':[");
out.println("['JavaScript 101', 'Lu Sckrepter','4412', 'Some long description'],");
out.println("['Ajax with Java', 'Jean Bean','4413', 'Some long description'],");
out.println("['Web 2.0 - Fact or Fiction','Wen Ficklestien', '4414','Some long description'],");
out.println("['CSS for Smart People', 'Desi Ng', '4415', 'Some long description']");
out.println("]");
out.println("}");

out.close();

gmurray71
Offline
Joined: 2003-07-31

Pagation of data depends on the widget code and I don't believe the Mochikit or Dojo Tables have support yet. I'm considering using the Rico Data control which does have support. If you are interested in helping out on this one it would be appreciated.

gmurray71
Offline
Joined: 2003-07-31

You can use a database to produce the data used by the table.

Here is an example of the data format:

{
"columns": { "title" : "Title", "author":"Author", "isbn": "ISBN #", "description":"Description"},
"rows":[
['JavaScript 101', 'Lu Sckrepter','4412', 'Some long description'],
['Ajax with Java', 'Jean Bean','4413', 'Some long description'],
['Web 2.0 - Fact or Fiction','Wen Ficklestien', '4414','Some long description'],
['CSS for Smart People', 'Desi Ng', '4415', 'Some long description']
]
}

You will need to create a servlet or JSP page that read the data to create the data like the service:

Instead of pointing the service at books.json you would point it to your serlvet or JSP page.