You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Ian Duffy <ia...@ianduffy.ie> on 2013/07/25 12:19:51 UTC
Updating list view after data addition.
Hi,
I've modified the "add account" screen to use a custom ui. The custom
UI displays a table of all LDAP users along with the required and
optional input fields.
When I add the user the user doesn't appear on the table of users
until the page is refreshed.
What is the correct way of handling this table update?
is it ok to do:
success: function(args) {
$('.list-view').listView('refresh');
close();
}
Thanks,
Ian
RE: Updating list view after data addition.
Posted by Jessica Wang <Je...@citrix.com>.
Ian,
> What is the correct way of handling this table update?
call "args.response.success()" with the embedded object returned in API response.
e.g. API response is:
{
"createaccountresponse": {
"account": {
"id": "7005b368-5da6-4a8b-a588-e7c5c113c40e",
"name": "bbb_user",
"accounttype": 0,
"domainid": "25a1e8b0-6cce-44cb-b724-8f5543fd85b8", "
~ ~ ~
}
}
}
pass the embedded object:
{
"id": "7005b368-5da6-4a8b-a588-e7c5c113c40e",
"name": "bbb_user",
"accounttype": 0,
"domainid": "25a1e8b0-6cce-44cb-b724-8f5543fd85b8", "
~ ~ ~
}
to args.response.success()
like this:
======================================================
success: function(json) {
var item = json.createaccountresponse.account;
args.response.success({
data: item
});
}
======================================================
Jessica
-----Original Message-----
From: Ian Duffy [mailto:ian@ianduffy.ie]
Sent: Thursday, July 25, 2013 3:20 AM
To: CloudStack Dev
Subject: Updating list view after data addition.
Hi,
I've modified the "add account" screen to use a custom ui. The custom
UI displays a table of all LDAP users along with the required and
optional input fields.
When I add the user the user doesn't appear on the table of users
until the page is refreshed.
What is the correct way of handling this table update?
is it ok to do:
success: function(args) {
$('.list-view').listView('refresh');
close();
}
Thanks,
Ian
Re: Updating list view after data addition.
Posted by Pranav Saxena <ps...@gmail.com>.
There's not much significant difference between the two except - The one I
suggested just refreshes the entire window (listView+ other extra items on
the UI) but the one which you wrote would just refresh the listView. From
the end user perspective , you won't realize the significance since
listView is the only panel which contains the data to be refeshed . Other
items are either the other sections /icons etc .Thus it might help if you
want to reload some CSS for some other items apart from the listView data.
Hope I answered your query here !
On Thu, Jul 25, 2013 at 5:47 PM, Ian Duffy <ia...@ianduffy.ie> wrote:
> Hi Pranav,
>
> That worked nicely. Thank you.
>
> What is the advantage of
> $(window).trigger('cloudStack.fullRefresh');
> over
> $('.list-view').listView('refresh');
>
> On 25 July 2013 12:31, Pranav Saxena <ps...@gmail.com> wrote:
> > Hey Ian ,
> >
> > So you got to code this up for fetching the latest state for the
> listvView.
> > What you have done is also right but I would suggest you try something
> like
> > this in your "success block" -
> >
> > $(window).trigger('cloudStack.fullRefresh');
> >
> > Let me know if this solves your problem.
> >
> > Thanks,
> > Pranav
> >
> >
> > On Thu, Jul 25, 2013 at 3:49 PM, Ian Duffy <ia...@ianduffy.ie> wrote:
> >>
> >> Hi,
> >>
> >> I've modified the "add account" screen to use a custom ui. The custom
> >> UI displays a table of all LDAP users along with the required and
> >> optional input fields.
> >>
> >> When I add the user the user doesn't appear on the table of users
> >> until the page is refreshed.
> >>
> >> What is the correct way of handling this table update?
> >>
> >> is it ok to do:
> >>
> >> success: function(args) {
> >> $('.list-view').listView('refresh');
> >> close();
> >> }
> >>
> >> Thanks,
> >> Ian
> >
> >
>
Re: Updating list view after data addition.
Posted by Ian Duffy <ia...@ianduffy.ie>.
Hi Pranav,
That worked nicely. Thank you.
What is the advantage of
$(window).trigger('cloudStack.fullRefresh');
over
$('.list-view').listView('refresh');
On 25 July 2013 12:31, Pranav Saxena <ps...@gmail.com> wrote:
> Hey Ian ,
>
> So you got to code this up for fetching the latest state for the listvView.
> What you have done is also right but I would suggest you try something like
> this in your "success block" -
>
> $(window).trigger('cloudStack.fullRefresh');
>
> Let me know if this solves your problem.
>
> Thanks,
> Pranav
>
>
> On Thu, Jul 25, 2013 at 3:49 PM, Ian Duffy <ia...@ianduffy.ie> wrote:
>>
>> Hi,
>>
>> I've modified the "add account" screen to use a custom ui. The custom
>> UI displays a table of all LDAP users along with the required and
>> optional input fields.
>>
>> When I add the user the user doesn't appear on the table of users
>> until the page is refreshed.
>>
>> What is the correct way of handling this table update?
>>
>> is it ok to do:
>>
>> success: function(args) {
>> $('.list-view').listView('refresh');
>> close();
>> }
>>
>> Thanks,
>> Ian
>
>
Re: Updating list view after data addition.
Posted by Pranav Saxena <ps...@gmail.com>.
Hey Ian ,
So you got to code this up for fetching the latest state for the listvView.
What you have done is also right but I would suggest you try something like
this in your "success block" -
$(window).trigger('cloudStack.fullRefresh');
Let me know if this solves your problem.
Thanks,
Pranav
On Thu, Jul 25, 2013 at 3:49 PM, Ian Duffy <ia...@ianduffy.ie> wrote:
> Hi,
>
> I've modified the "add account" screen to use a custom ui. The custom
> UI displays a table of all LDAP users along with the required and
> optional input fields.
>
> When I add the user the user doesn't appear on the table of users
> until the page is refreshed.
>
> What is the correct way of handling this table update?
>
> is it ok to do:
>
> success: function(args) {
> $('.list-view').listView('refresh');
> close();
> }
>
> Thanks,
> Ian
>