SHOWTASKGRID FUNCTION MAKES THE GRIDPANEL WHICH USES STORE OR RECORDSET IS SIMPLEDATASTORE, SHOW THE COLOUMN MODEL USES THE ROW SELECTION MODEL FOR SHOWING THE UPDATE FORM AND DOING THE DELETE OPERATION , IN FBAR I HAVE GIVEN THE BUTTONS FOR ADD UPDATE ,REFRESH, CLEAR GROUPING AND FOR LOGOUT ,I HAVE GIVEN FUNCTIO FOR DELETERECORD WHICH IS USED FOR DELETED THE RECORD AND MAKE NEW EXT.WINDOW AND ASSING THE GRID VARIABLE IN THE ITEMS OF WINDOW ... BY THIS GRID WILL BE SHOWN IN THE WINDOW....
} } ] }); function deleteRecord(btn) { if(btn=='yes') {
//returns record objects for selected rows (all info for row) var selectedRows = grid.selModel.selections.items;
//returns array of selected rows ids only var selectedKeys = grid.selModel.selections.keys;
//note we already did an if(selectedKeys) to get here
//encode array into json var encoded_keys = Ext.encode(selectedKeys); //submit to server Ext.Ajax.request( //alternative to Ext.form.FormPanel? or Ext.BasicForm.submit { //specify options (note success/failure below that receives these same options) waitMsg: 'Saving changes...', //url where to send request (url to server side script) url: 'deletetask.php',
//params will be available via $_POST or $_REQUEST: params: { task: "delete", //pass task to do to the server script companyID: selectedKeys//the unique id(s)
},
/** * You can also specify a callback (instead of or in * addition to success/failure) for custom handling. * If you have success/failure defined, those will * fire before 'callback'. This callback will fire * regardless of success or failure.*/ callback: function (options, success, response) { if (success) { //success will be true if the request succeeded Ext.MessageBox.alert('OK','record deleted');//you won't see this alert if the next one pops up fast var json = Ext.util.JSON.decode(response.responseText);
//need to move this to an after event because //it will fire before the grid is re-rendered //(while the deleted row(s) are still there Ext.MessageBox.alert('OK', ' record(s) deleted.');
//You could update an element on your page with //the result from the server //(e.g.) //var total = Ext.get('total'); //total.update(json.sum);
//the function to be called upon failure of the request (server script, 404, or 403 errors) failure:function(response,options){ Ext.MessageBox.alert('Warning','Oops...'); //ds.rejectChanges();//undo any changes }, success:function(response,options){ //Ext.MessageBox.alert('Success','Yeah...'); //commit changes and remove the red triangle which //indicates a 'dirty' field grid.getStore().removeAll(); grid.getStore().load(); } } //end Ajax request config );// end Ajax request initialization };//end if click 'yes' on button }; // end deleteRecord SimpleDataStore.load();
var wingrid = new Ext.Window({ title: 'Task Manager', id:Ext.id(), closable:false, width:1200, height:700, minWidth: 300, minHeight: 200, //border:false, layout:'fit',
items: grid }); wingrid.show(this); } FOR MAKING THE GROUPING STORE IN EXTJS I HAVE USED THE FOLLOWING CODE
var SimpleDataStore = new Ext.data.GroupingStore({ proxy: new Ext.data.HttpProxy({ url: 'tasklist.php', method: 'POST' }), reader: new Ext.data.JsonReader({
FOR OPENING THE FORM ON CLICK OF THE ADD BUTTON.....
USE THIS FUNCTION.....
function addTab(){ /*data store for project,employee,customer auttosuggest*/ var customer = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ url: 'customer.php' }), reader: new Ext.data.JsonReader({
}, [{name: 'customer'}, {name: 'customer'} ]) }); customer.load(); var project = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ url: 'project.php' }), reader: new Ext.data.JsonReader({
}, [{name: 'project'}, {name: 'project'} ]) }); project.load(); var employee = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ url: 'employee.php' }), reader: new Ext.data.JsonReader({
}); } win.show(this); } IN THIS FUNCTION FIRST I HAVE MAKE THREE DATA STORE FOR CUSTOMER,PROJECT,EMPLOYEE AUTO SUGGEST COMBO BOX IN THIS I WAS GETTING THE PROBLEM OF NOT GETTING THE DATA ON TYPING IN THE TEXT BOX THAN THROUGH SOME BLOG I GOT THE IDEA OF POSTING OF QUERY IN THE VALUE OF TEXT BOXT I GOT THAT IN THE POST VARIABLE THAN I QUERY WITH THAT POST VARIABLE WITH LIKE THAN MY PROBLEM IS SOLVED , THE CODOR HELPED ME IN SOLVING THIS PROBLEM THANKS TO HIM..
AFTER MAKING THIS AUTO SUGGEST I MAKED THE FORM PANEL IN WHICH ALL TEXT BOX AND AUTOSUGGEST I PUT THAN I MAKED NEW WINDOW AND ASSIGNED THE FORM SIMPLE VARIBLE TO WINDOW AND SHOWED IT ........
I HAVE MADED THE LOGIN LOGOUT FORM IN EXTJS IN THAT I GOT THE PROBLEM OF SESSION VARIBLE THAN I PUT THE ACTION ON LOGIN IS WINDOW.LOCATION TO ANOTHER PAGE THAN I GOT THE SESSION VARIABLE STOARGE
1.check broken link from http://www.dead-link-checker.com/en/ 2.check design all browser testing -every page 3.form submission and flow of dynamic website
to fetch the feed to the db def cfeed if params[:recache] and params[:secret]=="at123" cache_feeds expire_fragment(:controller => 'public', :action => 'index') # next load of index will re-fragment cache render :text => "Done recaching feeds" end end
uses the feed tool gem
# This will replace cached feeds in the DB that have the same URI. Be careful not to tie up the DB connection. def cache_feeds puts "Caching feeds... (can be slow)"
def read_cache @fr=@f @fr.map { |uri| begin feed = CachedFeed.find_by_uri( uri.address ).parsed_feed feed[:items].map { |item| {:feed_title =>feed[:title], :feed_item => item} } rescue [] # because there might not be anything cached for some feed(s) end
} .flatten .sort_by { |item| item[:feed_item][:published] } .reverse end
and for the view part use the following code
<% cache do %> <% lastday = -1 @aggregate.each do |item| %>
<% mydate = item[:feed_item][:published].getlocal if mydate.yday != lastday %>