Activex control for web print [closed] - printing

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I would like to find an Internet Explorer ActiveX control that will allow me to print a web page or part of web page to a specific printer without a dialog box.
Is there any activex plugin to achieve this?

I used ScriptX. The free version lets you set some basic parameters, see the example below.
Example:
<!-- MeadCo ScriptX -->
<object id=factory style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
codebase="http://[your path here]/smsx.cab#Version=7.0.0.8 ">
</object>
<script>
function printWindow() {
factory.printing.header = "This is MeadCo";
factory.printing.footer = "Printing by ScriptX";
factory.printing.portrait = false;
factory.printing.leftMargin = 1.0;
factory.printing.topMargin = 1.0;
factory.printing.rightMargin = 1.0;
factory.printing.bottomMargin = 1.0;
factory.printing.Print(false);
}
</script>

Related

How to implement bootstrap datepicker with text_field? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to use a bootstrap datepicker with my text_field inside form_for.
How should I rewrite
<%= f.text_field :some_date %>
line to store the selected date in some_date field?
date time picker just support input type for direct integration. but rails text_field create text area. So you can't do so directly.
You can either integrate datetimepicker onclick or mousedown event. Like we can do for div/span.
If you want to do so you need to override datetimepicker code which check for supported html elements.
code below which should change : link here
attachDatePickerElementEvents = function () {
input.on({
'change': change,
'blur': options.debug ? '' : hide,
'keydown': keydown,
'keyup': keyup,
'focus': options.allowInputToggle ? show : ''
});
if (element.is('input')) {
input.on({
'focus': show
});
} else if (component) {
component.on('click', toggle);
component.on('mousedown', false);
}
},
See this Demo & code and API
$('field selector').datepicker({
});

ViewBag does not show new line [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I want to show text on two separate lines for the page header:
#section featured {
<section class="featured">
<div class="content-wrapper">
<hgroup class="title">
<h1>#ViewBag.Message</h1>
</hgroup>
</div>
</section>
}
I have the following code in controller:
public ActionResult Login(string returnUrl)
{
StringBuilder sb = new StringBuilder();
sb.Append("Web Security Administration Portal");
sb.AppendLine();
sb.AppendLine();
sb.Append("Services, Inc. - SSOAdmin v2.00");
ViewBag.ReturnUrl = returnUrl;
ViewBag.Message = sb.ToString();
return View();
}
ViewBag does not show new line. When viewing source code of generated html, looks like that two strings are on separated lines, but when page is rendered, lines are not separated.
I tried to use sb.Append(Environment.NewLine) and sb.Append(Text{0}, Environment.NewLIne) as well. Does not help here.
What can be wrong here?
Environment.NewLine puts the text on multiple lines in the HTML that is created. However, white space such as new lines are ignored by most HTML elements. You should add <br /> where you want new lines.
Alternately, you could change that behavior by adding see to the enclosing element that adds:
white-space: pre-wrap;
The best bet to get that to work would be to have your ViewBag be wrapped in a <p>.

Partial View MVC 5 : "A space or line break was encountered after the "#" character [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
Here is the error:
"A space or line break was encountered after the "#" character. Only valid identifiers, keywords, comments, "(" and "{" are valid at the start of a code block and they must occur immediately following "#" with no space in between.
I am using MVC 5 and working through the book Pro ASP.NET MVC 5 - Adam Freeman. Here is the List.cshtml.
Main view
#model SS.WebUI.Models.ProductsListViewModel
#{
ViewBag.Title = "Products";
}
#foreach (var p in Model.Products)
{
#Html.Partial("ProductSummary", p)
}
<div class="pager">
#Html.PageLinks((SS.WebUI.Models.PagingInfo)Model.PagingInfo, x => Url.Action("List", new { page = x }))
</div>
Partial view
#model SS.Domain.Entities.Product
<div class="well">
<h3><strong>#Model.Name</strong>
<span class="pull-right label labelprimary"> # Model.Price.ToString("c") </span>
</h3>
<span class="lead"> #Model.Description</span>
</div>
I have tried various syntaxes and cannot get it to work - any help will be apprecaited!
Most probably you check your partial view code:
# Model.Price.ToString("c")
There is space after # for Model.Price.. # Model.Price.ToString("c") --> #Model.Price.ToString("c")

To show a hidden div with If-else condition for mobile quiz application

What I want to do:
I am trying to create a mobile quiz application that could display a list of questions in a form one by one.
What I am able to do:
I have read through this site and am able to scroll through the questions without any problems. Also, the Javascript scoring engine is working fine.
<script type="text/javascript">
$(document).ready(function () {
var currentQuestion=0;
var totalQuestions=$('questions').size();
$questions = $('.questions');
$questions.hide();
$('.scorepage').hide();
$($questions.get(currentQuestion)).fadeIn(); //show the first question
// when users click on the "Next question button...
$('#next').click(function(){
$($questions.get(currentQuestion)).fadeOut(function(){ //hide the current question
currentQuestion = currentQuestion + 1; //go to next question
if(currentQuestion == totalQuestions){ //if no more question
$('.scorepage').show();
$('.button1').hide();
}else{
$($questions.get(currentQuestion)).show(); //else display the current question
}
});
});
});
</script>
What is my current program structure:
The application begins with a form of n questions. Each question are framed using
<div data-role="fieldcontain" class="questions"> questions with radio button inputs </div>.
Following the question, there is a button, in which clicking on it will call the getScore() javascript. This section is framed as <div class="scorepage"> button here and a textbox to display score</div>.
Finally, the navigation button is at the end of the form. It is framed as <div class ="button1"></div>
What is my problem?
Before answering any question, the scorepage is hidden. This is achieved by the $('.scorepage').hide();.
However, I could not show the scorepage when there is no more question by using $('.scorepage').show(); and to hide the next button (Since there is no more question) by using $('.button1').hide();
Can anyone see where the mistake in my logic is?
To count the number of questions, try to using jquery function lenght for counting elements:
var totalQuestions = $('.questions').length
his should work

Twitter Bootstrap TreeView Plugin [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Does anyone know a mature plugin for a treeview in twitter bootstrap? Most things i found so far are
a) not longer maintained
b) looking ugly / have glitches
c) can't be initialized from a html unordered list
d) don't allow an element (node or leaf) to become selected.
Basically i need this to implement something similar to a file-explorer, but for an eCommerce Product catalog.
Thanks in advance!
Seems I'm a little late to the party but you could check out my jQuery plugin based tree view for Twitter Bootstrap.
Imaginatively named bootstrap-treeview.js!!!
It's at version 1 and will only support Bootstrap v3 upwards, but...
it will be maintained,
looks closer to the bootstrap look and feel than any other I've seen,
is data driven,
highly customisable look and feel,
has selectable nodes with event hooks
Check out the project's github page for full documentation, and take a look here for a live demo.
Take a look at the FuelUX tree
var treeDataSource = new DataSource({
data: [
{ name: 'Test Folder 1', type: 'folder', additionalParameters: { id: 'F1' } },
{ name: 'Test Folder 2', type: 'folder', additionalParameters: { id: 'F2' } },
{ name: 'Test Item 1', type: 'item', additionalParameters: { id: 'I1' } },
{ name: 'Test Item 2', type: 'item', additionalParameters: { id: 'I2' } },
{ name: 'Test Item 3', type: 'item', additionalParameters: { id: 'I3' } }
],
delay: 400
});
$('#MyTree').tree({dataSource: treeDataSource});
Here is a working example with data source:
http://bootply.com/60761
If you want a folder or item to be selectable, you'll need to look at the methods/events exposed by the control.

Resources