I am using kendo window with AngularJS in the following way.
HTML Code
<div kendo-window="showProspectDetailWindow" k-title="'Prospect Detail window'"
k-width="" k-height="" k-visible="false"
k-content="{template:confirmationWindowTemplate}"
k-on-open="" k-on-close=""></div>
JavaScript Code
$scope.confirmationWindowTemplate = 'Are you sure you want to delete?<br />This data will not be recoverable, do you want to continue ?<br /><div class="pull-right"><button class="k-primary" ng-click = "yesButton()">Yes</button><button class="k-button" ng-click="noButton()"> No</button></div>';
I have created a model in the script in the following way
$scope.createProspectDetailModel = function(data)
{
$scope.prospectDetail.AccountId = data.AccountId;
$scope.prospectDetail.BusinessType = data.BusinessType;
$scope.prospectDetail.FirstName= data.FirstName;
}
The above code works. With the help of debugger I can verify that the values from the data field are going into each of the $scope.prospectDetail value. However, when I change my template into
$scope.confirmationWindowTemplate = 'Are you sure you want to delete {{prospectdetail.FirstName}}'
It doesn't work. I also tried
$scope.confirmationWindowTemplate = 'Are you sure you want to delete {{#= prospectdetail.FirstName #}}'
but it doesn't work as well. I have referred this link on SO but didn't help. I have searched a lot but still cannot find the solution to this. Any help would be appreciated.
Ok. I found the answer myself. I changed the HTML Code . Removed the k-content
<div kendo-window="confirmationWindow" k-title="'Confirmation window'"
k-width="" k-height="" k-visible="false"
k-on-open="" k-on-close=""></div>
and assigned it in the script
$scope.confirmationWindow.content('Are you sure you want to delete'+ $scope.prospectDetail.FirstName '?<br />
Related
I am using intercooler.js in a django project.
http://intercoolerjs.org
<div id=right_side>
<form ic-post-to="{% url 'update-task-ajax' %}" ic-target="#right_side">
[...]
</form>
</div>
The form itself gets reloaded in the div #right-side after the first (working) use and after that intercooler is not working anymore. How to fix this?
Update:
Looks like i have to use
Intercooler.ready(func(elt))
http://intercoolerjs.org/reference.html
But i'm stuck how to use it properly.
I don't see anything wrong about this, the form should keep submitting and targeting #right_side each time, unless you are replacing it somehow. I don't see why Intercooler.ready() is necessary, given the code. Can you clarify what are trying to accomplish?
I'm availabe on the gitter chat for intercooler to help:
https://gitter.im/intercooler-js/Lobby
I am new to the AngularJs framework and I need some help with a couple questions.
I have tried to find information on the internet and by looking through tutorials but many of them are incomplete.
I have another problem: I must make a Web Application that will run on Phone Gap, but I don't know how to use a client side language. And I cant use JSP, etc
I read a Json file that's hosted on the server and parsed by Angular. Now when I want to do something with information I cant find how.
First: I want to take the number of the people that use the Tablet/Movil (like a loggin but not a loggin)
HTML part
<body>
<div ng-app="index" ng-controller="Ctrl1">
<p>
Indicar numero del grupo <input type="text" ng-model="numero">
</p>
Continuar
</div>
Looking on internet I find that you can use the following controller:
var app = angular.module('index', []);
app.factory("MyService", function() {
return {
data : {}
};
app.controller("Ctrl1", function($scope, $location, MyService) {
$scope.goTo2 = function() {
MyService.data.numero = $scope.numero;
$location.url("sugerencias.html");
};
app.controller("Ctrl2", function($scope, MyService) {
$scope.numero= MyService.data.numero;
And the HTML
<body>
<h1>Carta de Pedidos</h1>
<div ng-controller="Ctrl2">
<p>El numero de personas interesadas es : {{numero}}</p>
</div>
Obviously it doesn't work, and I need a small example that can help me to understand How to send the params to other
HTML
Second problem:
When I make a table with information by Json (dynamic information), that has a check box in each row, How can i know which row has been checked?
It`s possible that this question will be easy to experts but I am sure that I have not found the answer on the internet yet so I'm trying here.
Thanks to all people!!! =)
After looking many information on other pages and documentation, Angular its only used to make ONE PAGE webs. This kind on work its not eficcient on this framework. You must use differents divs that share information between them but dont move the information to other HTMLS.
I have looked at the other questions that are asking similar things to this question however when I attempted to create my own I can't get it to work properly and i dont understand why. It's only very basic before I introduce it into a more complex system I just wanted to try and get the functionality done.
This is my HTML;
<div id="test2">
Please enter a number: <input type="number" id="RValue1">
<button id="test" onclick="R1Value()">Change Value</button>
</div>
<div id="ShowR1"></div>
And this is the JavaScript;
function R1Value() {
var t = document.getElementById("RValue1");
var div = document.getElementById('ShowR1');
div.innerHTML = t.value;
}
I have made this fiddle to save time and so you can have a look at it,
http://jsfiddle.net/2ufnK/52/
I can't see why this doesn't seem to work so if anyone can see why I would really appreciate it. Thanks.
Try it without the button:
Try out this: http://jsfiddle.net/2ufnK/56/
Type in the text, then you can just call the, ".value", method to get its text. Then everything else works the way you've written it.
I have an Unapproved button on my list page. As I'm a complete rookie with angular, I don't really see how to pull out the id of the given post and update the column in db that makes sure it becomes approved. Can you please show me how to do that? The code goes smthn like this:
<form class="form-horizontal">
<button ng-click="approved()" class="unapproved" ng-if="article.current_revision.approved == false" ng-model="article.current_revision.approved">Unapproved</button>
</form>
What should I put in my controller to make this work?
It should be something like this where your controller has the approved fn which accepts the id.
ng-click="approved(article.id)"
Did I correctly understand your question? If not, please elaborate. A jsFiddle always helps tremendously too.
I have a file upload field,that is,<s:file> </s:file>. And I have a button "clear". On clicking this button, the field which has some file link should become empty.Could anyone help me with this?
My code:
<s:file id="filetestplanid2" name="testPlanDto.testFile" label="test"
tooltipIconPath="../../KY/images/common/buttons/uploadBtn.png"
title="Browse" tooltip="Browse..." cssClass="file" />
My javascript:
$('#filetestplanid2').val(null);
$('#filetestplanid2').val("");
I tried these but no luck.
Also tried:
var file = $("#filetestplanid2"); file.replaceWith(file = file.clone(true));
$('#filetestplanid2').html( $('#filetestplanid2').html() );
Assuming
<input type="button" onclick="clearFileElement('filetestplanid2');" />
Vanilla JS
function clearFileElement(fileId){
document.getElementById(fileId).value = '';
};
Demo: http://jsfiddle.net/2nxGr/
Can't make it works with jQuery but basically you have to substitute it with a clone of itself (with all the properties, gained using clone(true)).
Just stick to the plain JS version, it works like a charm.
EDIT
I've found now a very smart solution that works on every browser: https://stackoverflow.com/a/13351234/1654265
You can make it empty using Jquery too, just like this:
$("#filetestplanid2")[0].value = ""
or
$("#filetestplanid2").get(0).value = ""