|
hi,
i want to reload my datagrid using javascript below is my code but that is not working fine can anybody suggest me to reload data into datagrid
PageMethods.FetchINV(input_par, OnSuccess, OnFailure);
function OnSuccess(response) {
response.each(function (index) {
my_result += '' + index.carat + '' + index.price + '';
});
my_result += ''
+ '<span>1</span>'
+ ''
+ ''
+ '';
$("#dginventory").html(my_result);
}
|
|
|
|
|
Your code is hard to follow. Please correct the formatting
Beauty cannot be defined by abscissas and ordinates; neither are circles and ellipses created by their geometrical formulas.
Source
|
|
|
|
|
I'm trying to figure out what I am missing here - setting a multiple column sort initially is easy via aaSorting, but when I click on a column to sort, the only data I get on the server side is for just that one column.
I.e., if I have A, B, C columns I can set up to initially sort like this:
[code]
'aaSorting': [[2, 'asc'], [0, 'desc'], [1, 'asc']]
[/code]
All of which come as iSortCol_# on the server side. But if I click on column B, I only get iSortCol_0 on the server side, with iSortingCols = 1. In this case what I really want is to have B shifted up front so the new sort is [[0, 'desc'], [2, 'asc'], [1, 'asc']].
I just know I'm probably missing some property somewhere :)
Anyone?
|
|
|
|
|
when you write your entire question formatted as a code block it makes it difficult to read (IMO).
your code listed is somewhat generalized so I can't only offer the following as help:
iSortCol_0 will come in your server request and you need to interpret it's value to decide the column that you are going to be sorting your data on.
iSortCol_0 = 2;
iSortingCols - 1;
Have you tried hacking the fnServerParams[^] to debug the values that are being created for your server call?
"fnServerParams": function(aoData) {
for(data in aoData) {
var name = aoData[data].name;
var value = aoData[data].value;
var junk = 123;
}
}
Hopefully this helps get you started or at least pointed into the right direction. If you have a bug datatables then you will probably have to use it's debugger[^] and submit the result on their forums.
you want something inspirational??
|
|
|
|
|
Hello everyone
I am trying to share sessions between two web applications with coherence, one of them searching a data on data and store the session and the next one should shows the search result of the first application with retrieving the sessions and attributes which are set on it.
I do not know how use coherence technology for sharing sessions,
I am so thankful you guide me,
Thanks in advance.
|
|
|
|
|
I am not sure what back end system you are using but you could consider something like socket.io and/or redis or mongo to link the two sessions together and share the data by storing and referencing the data from the store via the sessions username or some id instead of the session id itself then all sessions with that username would be able to access and manipulate the attributes?
|
|
|
|
|
Thanks for reply
But I should use the coherence for sharing session, right now I am trying to deploy the war file to weblogic but unfortunately it is not successful
I am following this "http://docs.oracle.com/cd/E24290_01/coh.371/e22622/activecache.htm" tutorial but I ca not deploy the war file of application
I will be grateful if you can guide me,
Thanks so much
|
|
|
|
|
Hi, i'am worked a project. This project to my lesson and i need two webcam capture fotos and print or see this last screen. Have you got example or solution links ?
|
|
|
|
|
Not sure what I'm missing here. When I click the Total Cost button nothing appears in the text input. I've looked over the documents for any syntax errors but I am just not finding it!!
This is an assignment. I need to the total to be inside the input text box. I'm just looking for another set of eyes to see if I missed a semicolon or something simple somewhere.
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Woods | Order Total | Execise 5.3</title>
<meta charset="utf-8" />
<script type="type/javascript" src="j/exercise5-3.js">
</script>
<style type="text/css">
td, th, table {border: thin solid black;}
</style>
</head>
<body>
<form action = "">
<h3>Produce Order Form</h3>
<table>
<tr>
<th>Type of Produce</th>
<th>Price</th>
<th>Quantity</th>
</tr>
<tr>
<th>Apples</th>
<td>$0.59/each</td>
<td><input type="text" id="apples" size="2" /></td>
</tr>
<tr>
<th>Oranges</th>
<td>$0.49/each</td>
<td><input type="text" id="oranges" size="2" /></td>
</tr>
<tr>
<th>Bananas</th>
<td>$0.39/each</td>
<td><input type="text" id="bananas" size="2" /></td>
</tr>
</table>
<p>
<input type="button" value="Total Cost" onclick="computeCost();" />
<input type="text" size="5" id="cost" onfocus="this.blur();" />
</p>
<p>
<input type="submit" value="Submit Order" />
<input type="reset" value="Clear Order Form" />
</p>
</form>
</body>
</html>
JS File:
function computeCost() {
var apple = document.getElementById("apples").value;
var orange = document.getElementById("oranges").value;
var banana = document.getElementById("bananas").value;
document.getElementById("cost").value =
totalCost = apple * 0.59 + orange * 0.49 + banana * 0.39;
}
|
|
|
|
|
I think the problem is at your javascript declare statement.
Wrong:
<script type="type/javascript" src="j/exercise5-3.js">
Right:
<script type="text/javascript" src="j/exercise5-3.js">
|
|
|
|
|
That was it!! I knew it was something small!
|
|
|
|
|
I want to create a page in asp.net forms application where I can add product( with image upload), view product in grid(with asynchronous pagging sorting and filtering) and edit product by full aschronous mode using bootstrap theam or any good styling. But this is very hard for me to do everything without postack. I donot want to use any asp.net update panel or serversite controls , and if possible make the viewstate false as it slow-down my page. I search in google and got examples of MVC for this purpose. But for web forms application I donot get any helpful answear. Now I am doing this partially using jqwidgets, but I can't edit in this grid and for each product add I do postback.
So anyone please guide me to do this page full asynchronous in web form application.
Thanks, in advance
|
|
|
|
|
|
how do we create captcha with using Math.random() ?
|
|
|
|
|
Math.random() doesn't need to have anything to do with it. This really depends on the flavor of the month captcha that you are using.
I guess it is entirely possible if you are working with an existing captcha control that they are using Math.random() to seed it. In which case I would refer you to the docs.
If you are looking to create a captcha then I would recommend you do a search here on codeproject and use one of the articles that cover this as a basis for a starting point.
you want something inspirational??
|
|
|
|
|
I'm kind of new to web development...
It's such a soup of technology!
I'm currently working with ASP.NET MVC, jQuery,...
Anyhow, someone mentioned to me AngularJS[^]
How does it complement MVC? or web development in general?
What's your opinion on it?
|
|
|
|
|
AngularJs is an MVC implementation but not from the perspective of ASP.Net MVC like you are more familiar with.
more MVC client side (rendering) with a REST backend.
it is really popular with the Single Page application movement.
you want something inspirational??
|
|
|
|
|
I might give it a look anyway, just in case! ^^
|
|
|
|
|
I have a pagination page.At the first time, data and pagination links are generated from the server and shown them in my view.I have a drop down list.For every next time I want change the data and pagination links whenever dropdown list is changed without loading the page with jquery,ajax,json.I have successfully changed the data and links.I have created the pagination links as per first time server returns.But this time i can't trigger the ul>li>a element.I don't know why !!!.But the same js2 code works for the pagination which the server returns.
Html:server returns
<div class="pagination">
<ul>
<li class="disabled"><a >1</a></li>
<li><a href="http://localhost:8070/poralekha/home/universities/5">2</a></li>
</ul>
</div>
This works .
JS1:for pagination:
var pagination=" ";
pagination+="<ul >";
for(var i=1; i<=data['varsities'].length ;i++)
{
pagination+="<li class='disabled'>";
pagination+="<a href='#' class='page' >";
pagination+=i;
pagination+="</a>";
pagination+="</li>";
}
pagination+="</ul>";
$('.pagination').html(pagination );
here class='page' has been used for just get the value of i when .page is clicked
Js2:common for both pagination
$(".pagination > ul >li > a").click(function(event){
event.preventDefault();
alert("This index is clicked.");
});
or
$(".page").on('click', function(event){
event.preventDefault();
alert(" clicked.");
});
In short i want trigger when .page is clicked. I am just about to be mad with this.How can i solve this plz? Thanks.
modified 26-Jun-13 16:12pm.
|
|
|
|
|
I created the following from what you have written:
jsFiddle[^]
I don't see the problem that you are having?? Are you saying that you are getting a click event called for the static list and not the dynamic one that you are building??
Hopefully that jsFiddle will help some. You can edit and save your changes and then post back the new link if you want.
you want something inspirational??
|
|
|
|
|
Another homework assignment so please just let me know what direction I should go in.
Assignment details:
Function: counter
Parameter: An array of numbers
Returns: The numbers of negative elements, zeros, and values greater than zero in the given array.
Note: You must use a switch statement in the function.
My JS file:
var nums = new Array(-13,2,67,3,0,56,12,-41);
var len = nums.length;
for (i=0; i<len; i++) {
var count = nums[i];
}
var count = nums[i];
function counter() {
switch (count) {
case "negatives":
if (count < 0) {
document.write(count.length);
}
break;
case "zeros":
if (count == 0) {
document.write(count.length);
}
break;
case "positives":
if (count > 0) {
document.write(count.length);
}
break;
default: {
document.write("nothing!");
}
}};
I am not sure where to go with this one. I know it's the switch statement that throwing me off and I am not sure if my statement for counting each variable is necessarily correct either but I feel like I'm somewhere in the correct thinking here.
|
|
|
|
|
loop through the array and use switch on each element to increment the number of negative, zero and positive values..hope this helps..
|
|
|
|
|
You have all the parts but need to rework them a bit. I can't see how your calling the function but how about you pass the calculate function the array and then do your foreach with in the loop.
In the end you'll want to keep track of each element individually so you can properlly account for them. Currenlty your just doing a document.write but that could also be for debugging purposes.
Good Luck!
|
|
|
|
|
Use the sign function the values of which you can use in your switch statement:
var nums = new Array(-13,2,67,3,0,56,12,-41);
var len = nums.length;
var positives = 0;
var negatives = 0;
var zeroes = 0;
for (i=0; i<len; i++) {
counter(num[i];
}
function counter(number) {
var sign = (number > 0) ? 1 : (number < 0) ? -1 : 0;
switch (sign) {
case 1:
positives++
break;
case 0:
zeroes++;
break;
case -1:
negatives++;
break;
};
Regards,
— Manfred
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
I am currently a college student so please be kind to me being a novice! I am working on an assignment and I just can't figure out where I am going wrong.
Assignment Details:
Function: tst_name
Parameter: A string.
Returns: true if the given string has the form
String1, String2 letter
where both strings must be all lowercase letter except for the first letter and letter must be uppercase; false otherwise
My JavaScript file:
function tst_name(name) {
var ok = name.search(/^[A-Z][a-z]+, [A-Z][a-z]+, [A-Z]\.?$/);
if (ok == 0) {
return true;
} else {
return false;
}
}
var tst = tst_name(Woods, Trista, M);
if (tst) {
document.write("Program error <br />");
} else {
document.write("Valid name. <br />");
}
var tst = tst_name(woods, trista, m);
if (tst) {
document.write("Invalid name <br />");
} else {
document.write("Program error <br />")
}
My HTML file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"
>
<html lang="en">
<head>
<title>Woods | Test Name | Exercise 4.12</title>
<script type="text/javascript" src="exercise4-12.js">
</script>
</head>
<body>
<script>
document.write("Woods, Trista, M: " + tst + "<br />");
document.write("woods, trista, m: " + tst + "<br />");
</script>
</body>
</html>
When I view this in a browser it just shows:
Woods, Trista, M: undefined
woods, trista, m: undefined
So I'm just confused. I followed an example in our book and I just don't know what I need to do in order to get the variables to write the correct statements in my HTML document.
|
|
|
|