Search code examples
extjsextjs4extjs4.1extjs4.2sencha-architect

extjs 4 add new record to grid using form and finally to php mysql


I have researched lot of exampls for last 4 days but just couldnt come up with right approach.I am preparing extjs 4 app using sencha architect. There is a grid with lot of entries coming from store which is populated from php mysql backend. I am tryng to add new record using a button "Add Announcement" and the data should be entered using a form. grid store has three fields (Extra ID which needs to be passed on to new record in database) but the form has 2 fields. enter image description here form to enter or display data

Request your help in knowing the right approach. Possible options with me:

  1. create new record in store, send it to mysql. Select new record, edit the new record in form, again send it to mysql
  2. get a blank form, enter data, submit using url, create entry in mysql. send data back to store.
  3. use gridediting plugin to create new record. know how to use it for editing. Dont know how o create new record

In any case how should i pass class ID to the new record


Solution

  • If the record has only a few fields then #3 approach would do. I have written an example of grid with all CRUD operation, however, not in Architect. Anyway, the same or similar buttons handlers can be used for coding it in Architect.

    You can find the example here: http://extjs.eu/ext-examples/#writable-grid