once you have the dataview in a variable, the rest is easy.
The question was, if the dataview is instantiated declaratively, meaning in the markup, how do you 'get' the dataview to be able to set the data or fetch parameters or whatever else?
Hi, cgarland. Did you find a solution to this? I have been having the same issue with my application; I create a dataview declaratively, but I cannot update it - which i need to do after adding or deleting records. Using $get('dvName') doesn't seem to
return a dataview.
My only workaround was to create a gloval dv variable in my javascript, and then in the onCommand function for the dataview (like during an add or delete), I assigned it to the sender (dv = sender;) and then later in my onAddSuccess event function, I was
able to call dv.fetchData();
It's not a very good solution, and I'm sure there's got to be something I'm missing, but I was desparate and it seems to have worked for now.
If there is a way to do this, I'd like to hear it too.
cgarland
Member
25 Points
14 Posts
Refreshing a dataview with new fetchParameters
Mar 04, 2010 04:07 PM|LINK
Given this simple example:
</div>
cgarland
Member
25 Points
14 Posts
Re: Refreshing a dataview with new fetchParameters
Mar 08, 2010 12:19 PM|LINK
Is this really that hard of a question for the experienced users to answer? I thought this would be answered within half a day.
jnleavitt
Member
4 Points
9 Posts
Re: Refreshing a dataview with new fetchParameters
Mar 16, 2010 06:08 PM|LINK
I have been searching for the answer to that question as well, did you ever find an answer?
DylanRoberts
Member
9 Points
11 Posts
Re: Refreshing a dataview with new fetchParameters
Mar 18, 2010 04:39 PM|LINK
BUMP!
I have also been wondering about this!
I create all my dataviews imperatively, and keep references to them in global variables, mostly because of this issue.
What is the answer??
jnleavitt
Member
4 Points
9 Posts
Re: Refreshing a dataview with new fetchParameters
Mar 18, 2010 04:53 PM|LINK
i believe I got it to work by getting the data by a normal ajax call and then setting the data of the dataview using mydataview.set_data(mydata);
DylanRoberts
Member
9 Points
11 Posts
Re: Refreshing a dataview with new fetchParameters
Mar 18, 2010 05:46 PM|LINK
once you have the dataview in a variable, the rest is easy.
The question was, if the dataview is instantiated declaratively, meaning in the markup, how do you 'get' the dataview to be able to set the data or fetch parameters or whatever else?
babreu
Member
36 Points
31 Posts
Re: Refreshing a dataview with new fetchParameters
Mar 27, 2010 01:06 PM|LINK
Hi, cgarland. Did you find a solution to this? I have been having the same issue with my application; I create a dataview declaratively, but I cannot update it - which i need to do after adding or deleting records. Using $get('dvName') doesn't seem to return a dataview.
My only workaround was to create a gloval dv variable in my javascript, and then in the onCommand function for the dataview (like during an add or delete), I assigned it to the sender (dv = sender;) and then later in my onAddSuccess event function, I was able to call dv.fetchData();
It's not a very good solution, and I'm sure there's got to be something I'm missing, but I was desparate and it seems to have worked for now.
If there is a way to do this, I'd like to hear it too.
DylanRoberts
Member
9 Points
11 Posts
Re: Refreshing a dataview with new fetchParameters
Apr 12, 2010 04:00 PM|LINK
I found the answer, or at least a few good options, here: http://forums.asp.net/t/1540456.aspx
Feel free to mark as answer. :)