I'm currently using CrossVideo Galery 6.6 with DotNetNuke (DNN). I'm looking at the IDs of HTML tags within a ViewList and I'm seeing something like
<table id="**dnn_ctr782_ViewTagList_ctl04_dlTag**" cellspacing="0" style="border-collapse:collapse;">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="1">
<tr align="left">
<td align="left" valign="top">
<a id="**dnn_ctr782_ViewTagList_ctl04_dlTag_lnkName_0**" class="Normal" target="_self" ... >.mp4(2)</a>
<a id="**dnn_ctr782_ViewTagList_ctl04_dlTag_lnkRss_0**" ... >
...
This code snippet comes from the source code of the page at: http://dnnmodule.com/Modules/CrossVideoGallery/DNNVideoGalleryModule.aspx
I know the "782" portion of the id attribute pertains to the module id number. Can someone tell me what the “ctl05” pertains to? And is it stored within a table that I can access?
Turns out I can get the entire name by using the code in the ascx file and assign it right to a variable in javascript:
<script type="text/javascript">
m_ClientIdPrefix = '<%=this.Control.ClientID %>'; // retruns dnn_ctr2586_ViewList_ctl02
</script>
All ids will be prefixed with this when HTML is responded from the server. Useful if you want to manipulate anything on the client side of DNN.
Related
I have a table that has a custom element for the rows using as-element.
The table uses the element as follows:
<tbody>
<tr as-element="personnel-row" repeat.for="person of personnel" person.bind="person" is-compact.bind="isCompact"></tr>
</tbody>
Personnel-row looks like this:
<template>
<td if.bind="isCompact">${person.fullName}</td>
<td if.bind="!isCompact">${person.lastName}</td>
<td if.bind="!isCompact">${person.firstName}</td>
<td if.bind="!isCompact">${person.middleInitial}</td>
<td if.bind="!isCompact">${person.level}</td>
<td>${person.primary}</td>
<td if.bind="!isCompact">${person.status}</td>
<td>${person.certification}</td>
<td if.bind="!isCompact"><a route-href="route: personnel-detail; params.bind: {id:person.id}">View</a></td>
</template>
What's happening is that when it gets rendered, all of the tds are stripped out and all of the interpolated strings are directly inside the tr.
I'm aware of issues with having the wrong stuff inside tbody, or anything besides tds inside trs, but this is new to me. What could be causing this behavior?
EDIT: I apologize, I forgot to mention that this works fine in Edge and Chrome. The issue with the tds only happens in IE.
Getting my head around ngtable but what I cant find is a way to export the tabledata to a pdf format? Is there any plugin available that can do this?
We implemented http://www.cloudformatter.com/css2pdf with ng-table. Here's a fiddle to the sample:
http://jsfiddle.net/js64b/1181/
The relevant code is below. The one trick is to be sure to pass the option "namespaces" into the formatter to include (any) reference to the ng: namespace. In the example below, we just point it to "http://www.foo.net".
This is required as the content from the HTML DOM is scraped with these in place, turned to XML and transformed. This technique puts this (disregarded) namespace on the document so that it is not an error.
<script type="text/javascript" ng:autobind
src="http://code.angularjs.org/0.10.5/angular-0.10.5.js"></script>
<script src="http://www.cloudformatter.com/Resources/Pages/CSS2Pdf/Script/xeponline.jqplugin.js"></script>
<script src="http://www.cloudformatter.com/Resources/jquery.min.js"></script>
<div id="printme">
<table ng:controller="SortableTableCtrl">
<thead>
<tr>
<th ng:repeat="(i,th) in head" ng:class="selectedCls(i)" ng:click="changeSorting(i)">{{th}}</th>
</tr>
</thead>
<tbody>
<tr ng:repeat="row in body.$orderBy(sort.column, sort.descending)">
<td>{{row.a}}</td>
<td>{{row.b}}</td>
<td>{{row.c}}</td>
</tr>
</tbody>
</table>
</div>
<button onclick="return xepOnline.Formatter.Format('printme',{render:'download',namespaces:['xmlns:ng="http://www.foo.net"']});">PDF</button>
While it's not specifically built for ngtable, a plugin called jsPDF may work for you.
https://parall.ax/products/jspdf
or the git
https://github.com/MrRio/jsPDF
I been working on wizard . I been stuck in a tricky situation i.e
By default i am getting PREVIOUS , NEXT , FINISH . But i want to customize my wizard which having 4 stages .
on stage 1 & 2 : next & save button
stage 3 : send for approval
stage 4 : approve or reject
So for 4 stages i created 4 DIV's like this similarly
#using (Html.BeginForm("Index", "Home", FormMethod.Post))
{
<div id="step-1">
<h2 class="StepTitle">Step 1: Account Details</h2>
<table cellspacing="3" cellpadding="3" align="center">
<td align="center" colspan="3"> </td>
<tr>
<td align="right"> #Html.LabelFor(m=>m.Lead_Id) </td>
<td align="left">
: #Html.TextBoxFor(model=>model.Lead_Id , new { #readonly="readonly" } )
</td>
</tr>
<tr>
<td align="right"> #Html.LabelFor(m=>m.Contact_Name) </td>
<td align="left">
: #Html.TextBoxFor(model=>model.Contact_Name )
</td>
</tr>
<tr>
<td align="right"> #Html.LabelFor(m=>m.Contact_Address</td>
<td align="left">
: #Html.TextBoxFor(model => model.Contact_Address)
</td>
</tr>
<tr>
<td align="right"> #Html.LabelFor(m=>m.Lead_Source)</td>
<td align="left">
: #Html.DropDownListFor(c=>c.Lead_Source, Model.lead_sources)
</td>
</tr>
<tr>
<td> <input type="submit" value="SAVE" id="btnsave" /></td> // on click it does postback call to controller which saves my data accordingly . fine with that
<td><input type="button" onclick="donno()" value="NEXT STAGE" id="btnNext"</td> // Issue is here and what i need is onclick of button need to move to second stage of wizard so i been thinking to write a logic on click method of button ?
</tr>
</table>
</div>
}
I donno HOW ? Is it possible to call the next stage i.e next DIV of stage-2 to show up on-click.
Is there is any work around to bind DIV to the button . so on click of button that section of DIV should load in step2 of wizard .
Any better ideas are welcome and efforts are always appreciated .
Thanks & Regards
If you are trying to go through the steps of your wizard, you need some mechanism to do this. You have two options:
Use a jQuery wizard to handle everything client-side (you are talking about your <div>, so jQuery could "step" through each one"). Check this link out for a popular example: jQuery Wizard.
Although in the above you would use an MVC controller (or two if you use a partial view to display the "confirmation" or "submitted" page), another way to do this is using multiple controllers, one for each step, and then using TempData to keep user input data through the steps until you get to the end. Check this link out for an example: TempData Wizard.
You might get heated opinions about the use of TempData. I used the jQuery example before, but found it to be too cumbersome. I went the TempData route for simplicity (I hate LONG view or code pages, they tend to be hard to maintain).
Your mileage may vary, and ultimately it is up to you to decide what works best in your situation. Good luck.
Edit
Just also found a new (MVC5) link for using Session: Session Wizard. TempData is a form of Session, however, TempData is used for redirects in controllers, and unless you specifically "Keep" the TempData it is destroyed after the redirect. Both are not very secure, so just be aware of that (I believe in a secure application you can certainly use authentication (user or role based).
<table align="center" border="0" id="typeTable" >
<%for(int i=1;i<=count;i++){%>
<tr id="a">
<td align="left" valign="top">
<p>Problem Type <%=i+1 %></p>
</td >
<td align="left" valign="middle">
<p>Number of question to generate: </p>
</td>
<td align="left" valign="middle" >
<select name="type<%=i %>" id="mySelect" >
<option>0</option>
<option>5</option>
<option>10</option>
<option>20</option>
</select>
</td>
</tr>
<%}%>
<input type="hidden" name="totalNumOfType" value="<%=count%>"/>
</table>
Hi, I have the code above to do a for loop for the table row when I get a count from the database to show how many types of problems in math topic.
The drop down menu list name I have put the int I for the name to have each row an individual name so that I can pass the value of each drop down list selected to the next page which I can do successfully.
The issue now is I have problem disabling all the drop down menu list at onece using the javascript as it will not know how many count there will be.
I have used the following code to disable the drop down menu for example.
<script type="text/javascript">
function disable()
{
document.getElementById("mySelect").disabled=true;
}
function enable()
{
document.getElementById("mySelect").disabled=false;
}
</script>
I have been thinking but no avail. any help would be much appreciated. Thank you!
did you tryed jquery prop function : $("#mySelect").prop("disabled",true) ?
How can I locate an element "1988" (the fourth line) in the following table:
<table border="0" width="820" cellpadding="2" cellspacing="0">
<tbody>
<tr valign="top">
<td class="default" width="100%">Results <b>1</b> to <b>10</b> of <b>1988</b></td>
</tr>
<tr valign="top">
<td class="default" bgcolor="#C0C0C0"> <font class="resultsheader"> ...etc
</tr>
</tbody>
</table>
IMPORTANT: I know one way that works (By.xpath):
driver.findElement(By.xpath("//td[#width='100%']")).getText();
However, this way does not ALWAYS work. The page is dynamic, so I need a way to locate that element no matter what changes happen to the page.
I tried the following but I am not sure:
By.xpath("//html//body//table//tbody//tr[3]//td//table//tbody//tr//td[2]//table[4]//tbody//tr[1]//td//b[3]"
If you can't change the HTML and want to use attributes for selection, you can write something like this:
//table[#border=0][#width=820]//tbody//tr[1]//td//b[3]