JQuery :: Selectors - Create A Sort Of Alias For Variable?
Feb 4, 2011
In my jquery functions, I have many references like this: $("[id$=DDL_DOB_Day]"). I use this format as it works with master pages. The question I have is can i create a sort of alias for this variable so my code is not full of longwinded names? For instance:
Ok heres the scenario: I have a table with many rows in it. Each row has a checkbox in one cell, and a span in another cell. What I want to do in my jquery is to go through the table and find each row where the checkbox is checked, and then store the value of the span in an array. I thought you might be able to do it as a selector rather than using a loop. I tried this but it didn't work
I'm creating an inbox system for my website which allows basic communication between users. I'm fetching the results with jquery calling a webservice. Then I'm using a jquery template engine to render the results to the screen. So far this all works good. but now I want to add some click functions on certain parts of inbox messages. For example I want the title of the message to be clickable so it will expand/collapse the fulltext which is hidden in a div beneath it.
But I can't seem to use the jquery selectors on this dynamic json result. It works when I put the function in the href tag itself but I don't really want to. I also tried adding the function after the success function but no luck either. Is it possible at all to use selectors with a template engine? I hope I made myself clear otherwise feel free to ask more information.
I am developing a application in C#, ASP.NET and I have a lot os divs in my page, each div is a container for a chat message and each div have a unique id: like this
Is there a way of filtering large CSS files for the only required selectors on a page, and creating css files that contain just these selectors?
Case: I have a very large CSS file that I want to filter on a per page basis, so that the file size is cut down and can be cached by mobile devices. I was thinking along the lines of something like a server side dust me selectors tool.The particular project I am working on is using ASP.NET MVC.
i am able to click on the ImageButton and apply the Jquery highlight effect to a different div
$("#btnFavorite").click(function() { // selector for element to highlight $("#theDiv").effect("highlight", {}, 3000); });
Now i would like to extend the question as follows. I add the ImageButtons to the webpage dynamically, and i would like to apply the effect on the div for every ImageButton click.
What should i do in that case? By using ItemDataBound of the listview and adding attributes like btnFavorite.Attributes.Add("onmouseclick", "doSomething") or what?
I have a CustomValidator client script method that checks the value of a <input type="date" id="start"/> control. I'm accessing the date value using jQuery $('#start').val(), which works fine in Firefox and Opera. When I test in Chrome/Safari, the js console says that $('#start') is null. There is no problem using $('#start') outside the CustomValidator client method in Chrome/Safari. There is also no problem accessing the #start date object via document.getElementById('start') inside the validation method.
why jQuery selectors are failing inside this validation method for Chrome/Safari?
I am using jQuery for custom sorting my <ul><li> list.But I have a problem. I can sort and move those <li>-s but problem is I don't know how to update database with new order integers.Example of html ul li:
[Code]....
This is an example of my li element.. I have id=43, thats Id of picture in database.I use this javascript for trying to somehow make array and read that id into array:
[Code]....
Problem is I don't know exactly what am I doing wrong, because my event doesn't fire, when I press "update button.. Update button fires "update" function on click:
[Code]....
I hope someone will try to explain.Do codebehind and html needs to be in the same document? Can I use ascx and use "update" button there, to fire aspx methode?
Select ColA = ID ,ColB = Name ,ColC = invtotamt + (SELECT SUM(TableA.camount) FROM TableA WHERE TableA.csucceed = 1 AND TableA.cID = InventoryTotal.invID GROUP BY TableA.cID) ,ColD = ((SELECT SUM(TableA.camount) FROM TableA WHERE TableA.csucceed = 1 AND TableA.cID = InventoryTotal.invID GROUP BY TableA.cID) ,ColE = (SELECT SUM(TableB.camount) FROM TableB WHERE TableB.csucceed = 1 AND TableB.cID = InventoryTotal.invID GROUP BY TableB.cID) FROM TABLE
it look complicated, and long statement, actually it's easy, it is like: (it's a sample, not a really one)
Select ColA = ID ,ColB = Name ,ColC = ColD + ColE ,ColD = ColE + ColC ,ColE = ColC + ColD/100 FROM TABLE
it looks much easier with ALIAS. But, it seems i cannot directly use alias in select stetement like that. if i cannot use alise, i have to copy paste lots of same column definition. how can i use the alias in select statement?? this bothers me a lots of times!
My following sql query giving me the following error, What does it mean. Am i defining the alias fir column in wring way. Please help me out with this. My error is this and i am putting query just below the error. Error in SELECT clause: expression near 'Year'. Missing FROM clause. Unable to parse query text.
SELECT [tbl_students].passing_year as Passing Year,[tbl_branch].branch_name as Branch_Name FROM [tbl_students], [tbl_course], [tbl_branch] WHERE [tbl_students].course_id=@courseId AND [tbl_students].branch_id IN(64) AND [tbl_students].course_id=[tbl_course].course_id AND [tbl_students].branch_id=[tbl_branch].branch_id AND (@firstYrPercent is null OR [tbl_students].first_year_percent>=@firstYrPercent) AND (@secondYrpercent is null OR [tbl_students].second_year_percent>=@secondYrPercent) AND (@thirdYrPercent is null OR[tbl_students].third_year_percent>=@thirdYrPercent) AND (@finalYearpercent is null OR [tbl_students].final_year_percent>=@finalYearpercent) AND (@currentDegeePercentage is null OR [tbl_students].current_degree_percent>=@currentDegeePercentage) AND (@passoutYear is null OR [tbl_students].passing_year>=@passoutYear) AND (@currentBacklog is null OR [tbl_students].current_backlog=@currentBacklog) AND (@sex is null OR [tbl_students].gender=@sex) AND (@eGap is null OR [tbl_students].gapin_education<=@eGap) AND (@highSchoolPercentge is null OR [tbl_students].highschool_percentage>=@highSchoolPercentge) AND (@higherSchoolPercentage is null OR [tbl_students].ssc_percentage>=@higherSchoolPercentage) AND (@grauationPercentage is null OR [tbl_students].graduation_percentage>=@grauationPercentage) AND (@diplomaPercentage is null OR [tbl_students].diploma_percentage>=@diplomaPercentage) AND (@noOfAtkt is null OR [tbl_students].number_of_ATKT<=@noOfAtkt) AND (@validDate is null OR [tbl_students].DOB>=@validDate)
I have a web forms app with a CSS file for layout. One of my elements, which will be much more difficult to do in CSS without using IDs, also has to have runat="server" since I control visibility server side.
My problem is that in the CSS, I don't know how to ignore that whatever div with my selectors, and unless I inline the CSS and put in server to client control translation, I won't know the control names until runtime.
How should I work around this? Is there a server side container control that doesn't render output but could be used to contol the visibility/rendering of its contents, or is there a trick in CSS to ignore that intermediate div? This is additionally confused by the fact I have the x div in a master page and the whatever and y divs are both in the page itself. I know this wouldn't be an issue if I were using MVC, but at this point switching is not an option.
I have an application that I am developing using ASP.Net with visual basic code. I have a table called "Customers" that contains 3 fields. The name of each field is "Name", "LocationA", and "LocationB". I want to code a select query that list two columns. The first column should contain the field "Name". I want the second column to contain the value in the field "LocationB" if "LocationB" is not null, else I want the second column to contain the value in the field "LocationA".
I'm looking for a way to sort the rows of a datatable without setting the DefaultView.Sort to a specific column. I have a datatable in session that users can add records to. I want them to be able to sort the data by clicking on a button. But new records added after that need to show up at the bottom of the list until the sort button is clicked again.
I'm finding it next to impossible setting up a slideshow given the constraints I have. I could do it easily using a listview control except listview controls don't automatically page themselves! Is it possible to use jquery to create a play/pause button to auto page through the listview control, making it a slide show?
Just spent about 8 hours googling and looking through this forum for a solution on how to make sure that I can dynamically sort. Here is the situation.
I have 1 Gridview that displays 10 different scenarios based on what button is clicked.
I am also returning only top 10 records. I am doing all of the data binding pragmatically. So I have BoundFields, HyperLinkFields etc.
I also want to sort some records. When I change DataSource SQL statement the gridview somehow remembers what the last sort value was and it errors out saying that value "x" cannot be sorted because it does not exists.
Here I get an error that says that the data source does not support sorting? Doesnt it say gridview1.allowsorting = false;
I also tried gridview1.sort("", SortDirection.Ascending); This does nothin... except query my database one more time because i have a onSorting event that looks like this:
[Code]....
Here is an example of just one of those SLQ statements inside GetSQLQuery:
I want to create a twitter like user registartion form for my asp.net(C#) web application. I have configured asp.net membership module for my site. I have searched alot but couldn't find any all in one JQuery Plugin which provide the following functionalities to my webform
1. Form Feild highlight when onFocus and on error 2. Tooltip when form feild is in focus 3. Proper client-side form valodation 4. Check user name avalibility 5. Check email re-registration 6. Calculate Password strength 7. Nice feedback when form is submitted
Can anyone know any all in one plugin wich I can add to my asp.net(C#) registration forms to make my forms live? I'm extremly new to jquery and it my firstever jquery project.