Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 29, 2012 03:27 AM by CodeHobo
Member
7 Points
49 Posts
Nov 22, 2012 06:50 AM|LINK
Hi everyone
About the MVC with KnockoutBinding.
Now i have two ko.observableArray([]) object.
So, I want create one method for edit and send another one of these object as parameter sender.
for example
This is my code
var editData = function (rowEditIndex,DataObj) { data.firstName(viewModel.DataObj()[rowEditIndex].FirstName); };
Note: DataObj is parameter for received ko.observableArray([]) object.
Can i send parameter like this?
Could anyone help me please ? ^___^
Thank you in advance
Jittaboy
All-Star
21343 Points
1818 Posts
Microsoft
Nov 29, 2012 02:23 AM|LINK
It is better to post this question to their forums, you can get someone's help from there qucikly. And I also suggest you to refer their document.
http://knockoutjs.com/documentation/custom-bindings.html
Hope this helpful Regards
18647 Points
2647 Posts
Nov 29, 2012 03:27 AM|LINK
It really depends on what type of data is in the observableArray, but you can most definitely send data back to mvc. The trick is to model bind to a list. You can read more about it here http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx
Here is an old project I build for a presentation and shows you how to model bind to a collection from a Knockout observable
jittaboy
Member
7 Points
49 Posts
I would to send ko.observableArray([]) object as a parameter sending. Could anyone help me please...
Nov 22, 2012 06:50 AM|LINK
Hi everyone
About the MVC with KnockoutBinding.
Now i have two ko.observableArray([]) object.
So, I want create one method for edit and send another one of these object as parameter sender.
for example
This is my code
var editData = function (rowEditIndex,DataObj) {
data.firstName(viewModel.DataObj()[rowEditIndex].FirstName);
};
Note: DataObj is parameter for received ko.observableArray([]) object.
Can i send parameter like this?
Could anyone help me please ? ^___^
Thank you in advance
Jittaboy
Young Yang -...
All-Star
21343 Points
1818 Posts
Microsoft
Re: I would to send ko.observableArray([]) object as a parameter sending. Could anyone help me pl...
Nov 29, 2012 02:23 AM|LINK
It is better to post this question to their forums, you can get someone's help from there qucikly. And I also suggest you to refer their document.
http://knockoutjs.com/documentation/custom-bindings.html
Hope this helpful
Regards
Feedback to us
Develop and promote your apps in Windows Store
CodeHobo
All-Star
18647 Points
2647 Posts
Re: I would to send ko.observableArray([]) object as a parameter sending. Could anyone help me pl...
Nov 29, 2012 03:27 AM|LINK
It really depends on what type of data is in the observableArray, but you can most definitely send data back to mvc. The trick is to model bind to a list. You can read more about it here
http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx
Here is an old project I build for a presentation and shows you how to model bind to a collection from a Knockout observable
Blog | Twitter : @Hattan