Problem with Custom view

Sep 30, 2013 at 9:54 AM

I faced a problem when customizing the default UI. StandaloneTable.aspx does not load javascript files.
But I need to load the javascript files.

Is there any solution of this problem?

Sep 30, 2013 at 10:37 AM

The reason it is not loading the JavaScript is because (presumably) by the time you display that view, you are doing so via Ajax.

The simplest option is therefore to load all the JavaScript you need from the Master view, so that it is already there by the time you make the Ajax call.

Oct 7, 2013 at 11:13 AM
In ObjectEdit.aspx file below is the code :
<table id="myDataTable" class="display"> <thead> <tr> <th>All</th> <th>Service Order No</th> <th>Account</th> <th>License Type</th> <th>Services</th> <th>Status</th> <th>Offer Currency</th> <th>Invoice Currency</th> <th>IsRestorationService</th> <th>Role</th> <th>Creation Date</th> <th>Created By</th> </tr> </thead> <tbody> </tbody> </table> And in Site.WithServices.Master and also the Site.WithServices.Event.cshtml file I put the references needed to generate the jQuery grid datatable :

<link href="<%=Url.Content("~/Content/dataTables/demo_table.css")%>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery.dataTables.min.js") %>"></script>
    <script type="text/javascript" src="<%= Url.Content("~/Scripts/custom/serviceOrderList.js") %>"></script>
Problem is : from objectEdit.aspx file only the table header is generated.But data not generated.
But if I put Html code in a Index.cshtml file and put a Actionlink in ObjectEdit.aspx file like :

<%= Html.ActionLink("Service Order Grid View", "Index", "ServiceOrderList", new { id = "" }, new { target = "_blank", id = "printlink" })%>

data are generated by clicking a action link.

But I want to show the data from objectEdit.aspx file without clicking a actionlink.

Can you give any solution please?
Oct 7, 2013 at 11:28 AM

You have not said whether or not you tried what I suggested in my response to your previous question and, if so, whether or not that worked. So I am not clear if this is now a new question or the same one in a different form. Please respond to my previous answer first.

Oct 7, 2013 at 11:33 AM
Edited Oct 7, 2013 at 11:35 AM

I've tried your suggestion but the result is same. I put the references in ObjectEdit.aspx file. But it is not working.

Oct 7, 2013 at 11:55 AM
I'm struggling to follow this. You appear to be using a mixture of .aspx and .cshtml files - is that correct? If, so, why?

Your original posting said the problem was that the script was not being loaded. If you define that script in Site.WithServices.Master - and assuming all your pages inherit from that - then that script should be there from the outset. If it is not, then this suggests - to me - that you have, in the interim, gone to another view (that does not inherit from Site.WithServices.Master) where that script does not exist.

While it is not impossible to mix .aspx and .cshtml files in one app, it does confuse the issue somewhat - as the inheritance hierarchy may be less clear.
Oct 7, 2013 at 1:14 PM
I want to use jQuery datatable in NakedObjects framework. In which approach I will do that?

Do you have any suggestion?