I personally use ASP.Net for the backend - with WEB METHODS and not the traditional ASP.Net GET/POST/Partial POST-BACK garbage...
I then manage the APP in the browser with Javascript - using the jQuery library (really great library that helps with cross-browser issues and give a really professional look to your web app).
The javascript in the browser uses Ajax to talk to the server WEB METHODS and then uses jQuery to re-draw the parts of the DOM needed to manage the web experience.
The pages never re-load - no BACK or FORWARD action - just a perpetually running web app that uses AJAX async calls to get data and push data...
I use SLICKGRID for a grid - really, really cool.
I spent two years doing tradional ASP.Net pages - they are really a poor answer to creating a robust web experience for your users.
*** Read the sticky in the DB forum about how to get your question answered quickly!! ***
Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".
I personally use ASP.Net for the backend - with WEB METHODS and not the traditional ASP.Net GET/POST/Partial POST-BACK garbage...
I then manage the APP in the browser with Javascript - using the jQuery library (really great library that helps with cross-browser issues and give a really professional look to your web app).
The javascript in the browser uses Ajax to talk to the server WEB METHODS and then uses jQuery to re-draw the parts of the DOM needed to manage the web experience.
The pages never re-load - no BACK or FORWARD action - just a perpetually running web app that uses AJAX async calls to get data and push data...
I use SLICKGRID for a grid - really, really cool.
I spent two years doing tradional ASP.Net pages - they are really a poor answer to creating a robust web experience for your users.
Dear szlamany...
Thanks for the usefull reply.
Do you know where i can find some tutorials on the subjects you describe???
Learning how to write Javascript and work the browser - that's a learning curve - but I did it and I came from a VB background (javascript is very C-like in syntax).
Javascript is a really cool language actually - I love programming in it now. It's a prototype-based language - so it's very different then VB with classes and such
Not to hijack your thread or anything but I've always been curious. What is jquery really about ? I mean I've read up on it but my limited understanding of web programming in general renders me unable to fully grasp what problem its meant to solve. I mean like every time I read up on something jquery could do I always figure, "I can use normal JavaScript to do that"....what is the big deal about it anyway ?
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
Ok - here's a good example of jQuery making my life way easy. I'm currently working on a Purchase order entry screen. I did not want to use a grid for this as it needs some extra functionality that's hard to get in a grid.
First screen shot in the image shows two lines of the PO - when you walk off the end of the 2nd line a 3rd line is created. This is not a grid, so the DOM needs to be instantly modified for the user. That is the second screen shot in the attached image.
At the end of each row is a cool-little button that splits the row of the PO into several lines - as you click it it opens up new lines - and hides the button so you can't click it again. That is the third screen in the image. The split lines appear with AA, AB, AC (I'm going to hide that when I'm done with this code - just there for debugging purposes now). They are DISABLED textboxes - as you see they are greyed out.
So - first I need an event to fire when a certain field gets a FOCUS OUT - jQuery to set that up is this
That is a LIVE event - meaning I can add new fields to the DOM that have the class ".acs-input-field" and they automagically get the event assigned. I only execute this line of code ONCE - when the DOM READY moment happens. That's really cool. I never have to worry about creating a new field on the screen and forgetting to assign the events it needs to function!
Now - this is the FOCUSOUT function - the one that adds the NEW rows as you walk off an existing row
Code:
function focusoutField(sender) {
var wesAWC = $(sender.target);
var strRow = "";
var intRow = 0;
var strNew = "";
var wesNew = [];
if (wesAWC.hasClass("acs-newrow")) {
strRow = findClass(wesAWC.parent(), "acs-rownumber");
intRow = parseInt(String(strRow).replace("acs-rownumber", ""), 10) + 1;
strNew = "acs-rownumber" + intRow;
wesNew = wesAWC.parent().siblings("." + strNew);
if (wesNew.length == 0) {
wesNew = wesAWC.parent().clone().removeClass(strRow).addClass(strNew).addClass("acs-clone"); //.appendTo(wesAWC.parent().parent());
wesNew.find(".awc-POLines,.awc-POLines1").removeAttr("disabled");
wesNew.find(".acs-input-field").val("");
wesNew.appendTo(wesAWC.parent().parent());
wesNew.children().first().focus();
}
}
}
That's javascript calling jQuery methods. Note the IF statement about hasClass("acs-newrow") and then look in the attached image - and the HTML. See acs-newrow down on the awc-POLine6 row? The trick to jQuery is that you put classes on things that you want to behave a certain way and then you can do really uber-cool stuff with those classes. Look back at the code above - see the line that starts with wesNew = wesAWC.parent().clone()... That line and the next few lines are all that is needed to CLONE the row - add a class that labels the row (acs-rownumber3 for instance) - add a class that says it's a clone. Then it finds two elements in the clone - the clone isn't even in the DOM yet and jQuery can manage it - and it clears the values in those input elements. Then it appends it to the parent - and then it magically sets the focus to the first child element in the clone item it just dropped into the DOM.
Yes - you could do that with javascript alone. And you would have to worry about all the browser differences that can burn you. jQuery removes that nightmare.
Now - obvious problem is that when the user calls up a new PO - or starts a new entry - you somehow have to get the DOM back to a single row again.
Code:
function p_fillEditPanel(objPanel, strNewId, blnRefill, repeaterInfo, repeaterCur) {
var wesEP = $("#" + strNewId);
var wesPOClone = wesEP.find(".acs-clone"); //.remove();
if (wesPOClone.length != 0) {
wesPOClone.remove();
wesEP.find(".acs-panel-btn-split").show();
}
That's cool code! Since I labeled each row that was cloned with a class of acs-clone I can remove all that HTML from the DOM instantly with just a couple of lines of code.
wesEP - wes means "wrapped element set" to me - jQuery always returns an array of elements that are to be worked on. So wesEP is a pointer to the EDIT PANEL I am working on in the DOM. wesPOClone is an array of elements that have the ACS-CLONE class set - easy to find with .FIND(). Then a single line of javascript code - wesPOClone.remove() - removes all that HTML. And of course I have to re-show the SPLIT button in case they used that and it was .HIDE hidden...
jQuery makes DOM manipulation really easy. If you want to make a perpetual page - that uses ajax - and modifies the DOM as data comes flying in - jQuery is the tool that makes it work for you.
*** Read the sticky in the DB forum about how to get your question answered quickly!! ***
Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".
Ok - here's a good example of jQuery making my life way easy. I'm currently working on a Purchase order entry screen. I did not want to use a grid for this as it needs some extra functionality that's hard to get in a grid.
First screen shot in the image shows two lines of the PO - when you walk off the end of the 2nd line a 3rd line is created. This is not a grid, so the DOM needs to be instantly modified for the user. That is the second screen shot in the attached image.
At the end of each row is a cool-little button that splits the row of the PO into several lines - as you click it it opens up new lines - and hides the button so you can't click it again. That is the third screen in the image. The split lines appear with AA, AB, AC (I'm going to hide that when I'm done with this code - just there for debugging purposes now). They are DISABLED textboxes - as you see they are greyed out.
So - first I need an event to fire when a certain field gets a FOCUS OUT - jQuery to set that up is this
That is a LIVE event - meaning I can add new fields to the DOM that have the class ".acs-input-field" and they automagically get the event assigned. I only execute this line of code ONCE - when the DOM READY moment happens. That's really cool. I never have to worry about creating a new field on the screen and forgetting to assign the events it needs to function!
Now - this is the FOCUSOUT function - the one that adds the NEW rows as you walk off an existing row
Code:
function focusoutField(sender) {
var wesAWC = $(sender.target);
var strRow = "";
var intRow = 0;
var strNew = "";
var wesNew = [];
if (wesAWC.hasClass("acs-newrow")) {
strRow = findClass(wesAWC.parent(), "acs-rownumber");
intRow = parseInt(String(strRow).replace("acs-rownumber", ""), 10) + 1;
strNew = "acs-rownumber" + intRow;
wesNew = wesAWC.parent().siblings("." + strNew);
if (wesNew.length == 0) {
wesNew = wesAWC.parent().clone().removeClass(strRow).addClass(strNew).addClass("acs-clone"); //.appendTo(wesAWC.parent().parent());
wesNew.find(".awc-POLines,.awc-POLines1").removeAttr("disabled");
wesNew.find(".acs-input-field").val("");
wesNew.appendTo(wesAWC.parent().parent());
wesNew.children().first().focus();
}
}
}
That's javascript calling jQuery methods. Note the IF statement about hasClass("acs-newrow") and then look in the attached image - and the HTML. See acs-newrow down on the awc-POLine6 row? The trick to jQuery is that you put classes on things that you want to behave a certain way and then you can do really uber-cool stuff with those classes. Look back at the code above - see the line that starts with wesNew = wesAWC.parent().clone()... That line and the next few lines are all that is needed to CLONE the row - add a class that labels the row (acs-rownumber3 for instance) - add a class that says it's a clone. Then it finds two elements in the clone - the clone isn't even in the DOM yet and jQuery can manage it - and it clears the values in those input elements. Then it appends it to the parent - and then it magically sets the focus to the first child element in the clone item it just dropped into the DOM.
Yes - you could do that with javascript alone. And you would have to worry about all the browser differences that can burn you. jQuery removes that nightmare.
Now - obvious problem is that when the user calls up a new PO - or starts a new entry - you somehow have to get the DOM back to a single row again.
Code:
function p_fillEditPanel(objPanel, strNewId, blnRefill, repeaterInfo, repeaterCur) {
var wesEP = $("#" + strNewId);
var wesPOClone = wesEP.find(".acs-clone"); //.remove();
if (wesPOClone.length != 0) {
wesPOClone.remove();
wesEP.find(".acs-panel-btn-split").show();
}
That's cool code! Since I labeled each row that was cloned with a class of acs-clone I can remove all that HTML from the DOM instantly with just a couple of lines of code.
wesEP - wes means "wrapped element set" to me - jQuery always returns an array of elements that are to be worked on. So wesEP is a pointer to the EDIT PANEL I am working on in the DOM. wesPOClone is an array of elements that have the ACS-CLONE class set - easy to find with .FIND(). Then a single line of javascript code - wesPOClone.remove() - removes all that HTML. And of course I have to re-show the SPLIT button in case they used that and it was .HIDE hidden...
jQuery makes DOM manipulation really easy. If you want to make a perpetual page - that uses ajax - and modifies the DOM as data comes flying in - jQuery is the tool that makes it work for you.
Thanks....That makes quite a lot of sense. It seems you can eliminate a whole lot of tedious boilerplate associated with DOM interaction. These real prize though is the elimination of cross browser issues. When I was dabbling in ASP.Net a year ago, cross browser compatibility was the most frightening aspect of Web programming.
I will return to the domain of Web programming someday and I will definitely look into jquery. Although, I must say it seems a little intimidating. However, the way you're using it seems to imply that it was made to embody a functional style of programming in similar vein to functional LINQ and hopefully, that will make it easier to digest. Thanks for the explanation
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
JQuery is just ONE of many AJAX libraries out there. It just happens to be the most commonly used one. Yes, it takes care of the boilerplate interactions of the DOM and also deals with the variations in the browsers. It's probably not all that different from .NET where you have a common framework that you develop against, and some engine layer takes care of the thread counting on the nuts & bolts.
Which is a great reason to use it - the amount of "free" and powerful UI widgets - like that SLICKGRID - make it a winner.
And I wouldn't really call it an AJAX library - AJAX is just one of the methods available in the library. It's the dozens and dozens of DOM manipulation methods that make it powerful.
AJAX is nothing if you cannot deal with the RETURN DATA in a robust fashion.
This link is for jQuery UI widget page - spend some time here and see how powerful it is.
Now - go to this page - themeroller - click on the GALLERY button. This is a complete set of CSS styling that is also "editable" by you from this page - pick a theme - then click on the EDIT button.
It's probably not all that different from .NET where you have a common framework that you develop against, and some engine layer takes care of the thread counting on the nuts & bolts.
Just want to clarify this point a bit.
It's a browser library - not a backend library.
Being able to stay in the browser - never making a postback to the server - and still get DOM changes happening - lightening fast. That's cool.
I spent a couple of years doing traditional ASP.Net pages. Asking the server to help me alter a update panel in the browser is taking a long trip around to do something that you can do locally in the browser with Javascript/jQuery...
*** Read the sticky in the DB forum about how to get your question answered quickly!! ***
Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".
Wow.....I never knew about this. I always figured when I moved to Web development, I'd have to write all those things from scratch, which would have been immensely fun but wouldn't be good if I have to meet deadlines. It can really get tedious creating complicated logic in a dynamically typed language like JavaScript. It just makes it so difficult to debug.
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
I write none of that stuff from scratch - the accordions and autocompletes - the tab panel I use - all part of the library. And all respecting the themeroller so I can change up the color theme without writing a single line of CSS.
My web app - at this point - is 7000 lines of javascript code. That same web app runs at lawyers offices, labor unions - town halls. Same app.
The app gets the "names" of buttons from the database - the names of the column headings - all of it is generated via ajax calls at runtime. The names of the accordions - all at run time. The content of the accordions - all downloaded via ajax when the page boots up initially. All stored in the DOM and reused if need. The ACCOUNT LOOKUP is a jQuery UI AUTOCOMPLETE - and when the PO screen replicates the ACCOUNT # on the TAB it sources the data to what was loaded when the DOM booted up initially.
Same app - running at all my clients sites. That is true code-reuse. Granted my edit panels - like what I posted up above - are HTML hardcoded for that one single business purpose. But they sit in a hidden pool of html and the jQuery drops them into place. Eventually I will send those HTML-panels when the app boots with some ajax calls - and actually stored them either in my database or a folder on the server - wherever it might be easier for the web method to get to them.
Even the icons on the jQuery BUTTONS are part of the boilerplate
I just added graphing and plotting to the app - using jqPlot - a free library of graphing tools. Adding that to the app and now all my clients have graphing ability of any slick grid they want.
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
Yes - without it that would not be possible. Just styling the buttons like that - effortless.
I got disillusioned with ASP.net - when I couldn't get repeaters and update panels to be bug-free in a stupid attendance screen for teachers to use (the top line wouldn't refresh like the other lines!)...
Then I read that manning book - I mentioned in post #4 - "jQuery in Action". Didn't know a lick of javascript at that time.
Jumped head first into this and would never look back again.
Last edited by szlamany; Jun 14th, 2013 at 01:39 PM.
*** Read the sticky in the DB forum about how to get your question answered quickly!! ***
Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
Post #11 that I made in this thread gave you a link to getting started with the slick grid.
Post #13 that I made in this thread actually gave you the page source - viewed from my browser - of the simple example of the grid. You need to get a web probject started in VS and get that type of page working.
That's a lot to chew off and get started from one thread that you posted here - but that's the hurdle you must overcome.
At any rate - get started - when you hit a road block - post a new thread (in the javascript or jquery section of this forum) and ask that small question and hopefully we can all help push you along.
This thread has pretty much reached the end of it's life...
*** Read the sticky in the DB forum about how to get your question answered quickly!! ***
Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".