• Show Bootstrap Tooltip Over Truncated Text

    I had a need to prevent text-wrapping in a cell. I wanted the text to appear truncated to keep the row height consistent. The following worked well to crop the text and show an indicator of hidden text:

    I referenced the classes like so:

    Next, I wanted the user to be presented a tooltip if the text was truncated so they could see the full value. Here is my solution:

    This snippet watches for mouse placement over the DIV. It then does some width comparisons to see if there is any hidden text. If so it

    [Read More...]
  • Ajax Script Loading that Enforces Order of Execution

    One awesome feature of jQuery is the ability to load external scripts on demand. The $.getScript method loads the script behind the scenes via ajax. In fact the function is simply an alias to call to jQuery’s $.ajax function. By default that alias does not look for a cached items. In my particular need I wanted to observe a cache and guarantee order of execution. I resorted to using the $.ajax function directly since it offers more options. I did not want a script to load before it’s dependency nor did I want to bog down my page by doing

    [Read More...]
  • AJAX and Bootstrap Tabbing in MVC

    In this tutorial you will see the Twitter Bootstrap tabstrip in action. I will be using MVC, Razor and jQuery to accomplish this. If you visit the tabstrip documentation you will see an example that uses static tab content. I have expanded upon that code snippet, converting it to dynamic content using AJAX. I’m also utilizing a fading transition effect as the content loads. The tabstrip will interact with two partial views named: _SearchTab.cshtml and _SubmissionTab.cshtml. Notice that I am naming the tab ids the same as the partial views. Doing that reduces translation in the script when relaying the

    [Read More...]
  • AutoHotKey – Start with Windows

    AutoHotkey is a free, open-source scripting platform for Windows. You can use it to automate repetitive, tedious tasks or to turn just about any action into a keyboard shortcut. Once a script has been written and compiled there may be a need to have it automatically start with Windows. There are two ways to do this: startup folders or the registry. Both techniques are explained below: Use a Shortcut This will create a shortcut in the common startup folder to launch an application:

    To create it in the user’s startup folder replace A_StartupCommon with A_Startup. Start in the Registry

    [Read More...]
  • SQL Server & XML

    Recently I was working on a stored procedure for datatable pagination in .NET. Instead of passing in multiple parameters consisting of arrays/associated arrays I opted to pass one XML value containing all the information in an organized fashion. But then I had to do my research on how to extract the data within SQL Server after the handoff. After some testing I discovered how to parse tags, and even attributes, before crafting a final, dynamic SELECT statement. I tested this technique with large amounts of records (i.e., 400,000+) with success in both web forms and MVC. The XML parsing time

    [Read More...]
  • jQuery Select2 Validation

    Since my recent post for jQuery TE Validation seems to be popular ( at least for my site ) I thought I would demonstrate how to validate another plugin that doesn’t work right out the gate. I’m referring to the Select2 plugin. It is a jQuery replacement for SELECT boxes with a BootStrap type of look. It can product a listbox similar to Facebook’s popular multi-select style. Other options include list item images, searching, sorting (with drag & drop), infinite scrolling, and much more. We will be validating it with the jQuery Validation plugin. This example uses the following external

    [Read More...]
  • Accessible FontAwesome Image Buttons

    FontAwesome is a cool resource to use in web development. As its name suggests it is a font (like webdings/wingdings), except it has images that are actually useful. Some icons include edit, delete, email, save, lock, comment, search, facebook logo, etc. But since it’s a font some may wonder how to use it in an accessible way. Here is an example of an edit button:

    Some of the classes being referenced are:

    This example places an edit icon on an empty BUTTON tag with the "fa fa-edit" classes. I have also included CSS to remove the browser styling

    [Read More...]
  • Transform XML into HTML in .NET

    I was recently working on a project where I needed to create an HTML receipt for a client. Instead of building the HTML on the fly I decided to keep the data and display separate. My goal was to create a mail-merge type of process where XML is referenced in an HTML template. I accomplished this using XSLT. This article explains the steps I performed to complete this process. I began by adding the details of my receipt into XML using the XmlDocument object. To make this easier I added some helper extensions to my project. These extensions make it

    [Read More...]
  • PHP Development in Eclipse

    I’m a Windows user that had a need to build a project in PHP. Spoiled by Visual Studio I was seeking a sophisticated IDE that supports breakpoints, IntelliSense, syntax coloring, source formatting and the ability to view output. I wanted it to be a free solution and not with limited features. After trying some disappointing nugets in Visual Studio, itself, I began looking into Eclipse. Eclipse is an open source development environment that supports many languages. It is free, powerful and respected. The vast majority of Android apps owe their existence to Eclipse. For this project, that was the route

    [Read More...]
  • Alternative to Using Tables for Layout

    Most developers are familiar with tables and how they behave. They have relied on them heavily in the past to display data as well as templating and design. But as we learned in my previous post you are no longer encouraged to use them for layouts. You should use CSS instead. When I first started dabbling with DIV tables I used the CSS float property to mimic cells. But in many situations that method forced me to be overly specific on the heights and widths of my cells. It seemed to be two-times the work. Also vertical alignment and centering

    [Read More...]