Admin actions on the same page, is it possible?

Hi

I am building a project, and i’d like to handle every action(create, update, delete, overview) on the same page. I use ajax, and partial views to reload and to handle the form actions. For the overview, i use the generic gridView of Yii (basically thats the original admin view). So far everything went alright, but i experienced some wierd stuff. Everything individualy working perfect, but together something goes wrong. After i trigger an update it will load all the information to the form as rendering a partial view but after if i initiate a delete action it not refreshes the gridView just hides the update form(that part actually good). But i dont get it why its not refreshing the gridview anymore. And the other wierd stuff is: right after i create a new item, its refreshing the gridView but when i try to edit some already existing entry, instead of displaying the update form as a partial view, it navigates to update/id/xy page, and the same with the delete action as well goes to delete/id/xy.

Does anybody know whats happening?

Thanks!

I figured out this problem, after i reload the gridview i need to reload the javascript which handles the button actions as well in the gridview, but the other thing i still dunno whats happening :S

I figured out what was the problem with the gridview refreshment.

Actually I used an ajax call if a delete button was clicked:

Look liked this:




                $.ajax( {

			url : url,

			dataType : 'GET',

			error : function() {

				alert('this project can not be deleted!');

			},

			complete : $('#adminGridView').load('/projecten/admin/reload/true')

		});



the problem was somehow, which is in the complete parameter, is called earlier than, which is in the url. In some rare cases i noticed, that the refreshment execution time took longer, than the delete action and in these cases it looked like works good.

So i came up with an idea, putting the complete in a separate ajax block… and in this case its seems to work ok, although the delete exection time is still longer in some cases, then the refreshment. It needs a page reload.

Somebody can tell me why is it just happenning?