Click here to Skip to main content
15,910,083 members

Comments by vezo11 (Top 68 by date)

vezo11 2-Nov-15 6:29am View    
I tried two ways of editing data:
- using method: self.selectRow(row){
self.ModelToEdit(row);
}
- using method: self.selectRow(row){
self.ModelToEdit = new MyModel(ko.ToJS(row));
}

when using method no2 i had to reload parts of html page with ko.appyBindings(MODEL, dom)

and when using method no1 i, the data was successfully 'copied' but i couldn't see it on html :(

and yes, i'm using jQuery ajax to retreive data to MODEL collection

i hope this helps...
if not, please say what else might be more helpful..

thank you
vezo11 18-Oct-15 12:57pm View    
Ok, thanks Maciej. The last solution works fine.
vezo11 18-Oct-15 11:11am View    
I tried with this:
SELECT t1.*, t2.*
FROM Table1 AS t1 INNER JOIN (
SELECT *, ROW_NUMBER() OVER(ORDER BY Date DESC) AS RowNo
FROM Table2
) AS t2 ON t1.ID = t2.FK_Table1
WHERE t2.RowNo=1

But the result is the same as with the LEFT JOIN. Or Im missing something?

Thanks
vezo11 18-Oct-15 10:57am View    
Yes I saw. This (updated) query return only one row from the first and second table with highest date. I need all rows from the first table and related row from the second table with highest date. If you look at examples tables in question, your query return one row: 1 | 2| 2.1.2015

Thanks
vezo11 18-Oct-15 10:48am View    
Thanks Maciej for your replay. I have already tried this, but that dont work for me. This query select all rows from the first table and all related rows from the second table.