Yii Framework Forum: Admin actions on the same page, is it possible? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Admin actions on the same page, is it possible? Rate Topic: -----

#1 User is offline   JMC 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 16-December 09
  • Location:Nederlands, Den Haag

Posted 23 February 2010 - 03:02 AM

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 bring the sunshine baby... wherever I go =)
0

#2 User is offline   JMC 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 16-December 09
  • Location:Nederlands, Den Haag

Posted 23 February 2010 - 03:22 AM

View PostJMC, on 23 February 2010 - 03:02 AM, said:

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.



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 bring the sunshine baby... wherever I go =)
0

#3 User is offline   JMC 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 16-December 09
  • Location:Nederlands, Den Haag

Posted 25 February 2010 - 02:43 AM

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?
I bring the sunshine baby... wherever I go =)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users