durandal - How to create and use an Excel Web App with DurandalJS? -
i'm trying add excel web app durandaljs website. basically, json object server, transform <table>...</table>
tag excel web app can understand it. i'd able view table excel web app (resize columns, select, sort, filter, etc).
to start off, i'm trying simplest solution possible - hardcoded ![<table />][1]
:
- created new durandaljs project (using template on their website)
- replaced content of
welcome.html
following code found on excelmashup.com:
<a href="#" name="microsoftexcelbutton" data-xl-tabletitle="my title" data-xl-buttonstyle="standard" data-xl-filename="book1" data-xl-attribution="data provided company" ></a>
<table> ... </table>
<script type="text/javascript" src="https://r.office.microsoft.com/r/rlidexcelbutton?v=1&kip=1"></script>
but durandal show table data, ignoring excel button. same thing happens when try moving last line (<script/>
) index.cshtml
.
any ideas how can have excel-like behavior view table under durandal?
thanks!
p.s.: real project working on durandal 1.2 time being i'll take solution, durandal 2.0.
durandal doesn't render script tags within views. render them, should use knockout custom bindings:
ko.bindinghandlers.excelscript = { update: function( element, valueaccessor, allbindingsaccessor, viewmodel, bindingcontext){ $(element).html('<script type="text/javascript" src="https://r.office.microsoft.com/r/rlidexcelbutton?v=1&kip=1"></script>'); } };
use in view:
<div data-bind="excelscript"></div>
Comments
Post a Comment