PDA

View Full Version : add/delete/edit rows in grid


aclavijo
05-04-2007, 10:20 AM
Hi,

greetings,

please give me sample code to add/delete rows in the js-array that is used to create grid.

I want to add/delete rows and refresh the grid.

please give me sample code.

thanks for the anticipated cooperation

Clavijo

jsakalos
05-04-2007, 10:22 AM
Watch videos you find here:
http://extjs.com/forum/showthread.php?t=5498

aclavijo
05-04-2007, 09:33 PM
I need add/delete/edit rows in grid that show information from a data base. Culd you show me almost one example.

thanks

jsakalos
05-04-2007, 09:59 PM
I'm not sure what do you need example of because insert and delete of rows is covered in that video.

I cannot give you an example of server-side processing as these technologies vary.

aclavijo
05-04-2007, 10:44 PM
what I need is a grid that extract data fron database(MySql), and then the grid allows me add/edit and save information in a database

jsakalos
05-05-2007, 05:29 AM
If you want to accomplish this you have to do it step by step. All big things are composed of small ones.

First of all, have you watched videos?

My help philosopy is: I will not solve your problem for you but I will help you to be able to solve your problem yourself.

Thus, if you expect that I will write your application for you, I won't. But if you expect that you will invest your own work, time, effort to understand concepts of Ext then I'm here to give you a hand.

aclavijo
05-05-2007, 02:30 PM
I saw the video, but I don

jsakalos
05-05-2007, 02:53 PM
There is save button in video and the onclick hadler that executes the action.

aclavijo
05-05-2007, 03:32 PM
I think you don

jsakalos
05-05-2007, 03:52 PM
It seems that you are trying to do impossible: Create database connection from Ext. Javascript runs on client and sql server runs on server. It is impossible to create an database connection from javascript program running on client to mysql server.

However, it is possible to submit (send) data from javascript to server. This submitting (sending) has nothing to do with any database connections. Data sent from javascript can but does not necessarilly has to be saved to a database BY SERVER.

The database connection is created by server upon reciept of data.

http://www.php.net/manual/en/language.variables.external.php

aclavijo
05-05-2007, 04:16 PM
thanks a lot, but you know how can I show data in a grid from my data base

jsakalos
05-05-2007, 04:31 PM
It's just reverse process: You send request to server, server prepares data and sends it to you.

Here is an example how to do it: http://extjs.com/deploy/ext/examples/grid/xml-grid.html (http://extjs.com/forum/../deploy/ext/examples/grid/xml-grid.html)

Just one remark: The server does not have to send data in xml format but it can also be json.

aclavijo
05-06-2007, 05:10 PM
in found a grid that call in a js another archive grid-paging-data.php'


var ds = new Ext.data.Store({
// HttpProxy should be used here
proxy: new Ext.data.ScriptTagProxy({
url: 'http://www.vinylfox.com/yui-ext/examples/grid-paging/grid-paging-data.php'
}),


the grid-paging-data.php' [COLOR=black]have this sentences, but dosen

jsakalos
05-06-2007, 05:53 PM
If you have copied and pasted grid-paging-data.php from the example to your server it is very logical it does not work.

You have to run a PHP enabled web server on your server then MySQL server. You have to have database and tables created on MySQL server, then you have to have setup privileges (user names, passwords) on the MySQL server and then it can work.

All the above is reason that server side is not discussed or helped on on this forum as there are many server technologies. PHP/MySQL is only one of them.

If PHP/MySQL is your case you have to consult PHP and MySQL documentation as to setup the servers, databases, privileges.

This is client side Ext Help forum and it would be waste of time for you to try to get PHP/MySQL support here.

JasonMichael
05-07-2007, 03:58 PM
You should realize that the code above is written for a specific user's server and database. It isn't going to work, except from *their* server, and you need to put in your own values for the database to connect to, as well as a URL to retrieve data from... this is the case with most of the example on this site - if you try to use MySQL calls to a database that doesn't exist on your server, its not going to work...

The people who post code here, just assume we all know this.

aclavijo
05-08-2007, 09:46 PM
I dealt with the name of my data base, but in any case she did not work. I do not know if he is mysql_pconnect or the URL