Skip to Navigation | Skip to Content



XUI Sweeter then ever. | November 5th, 2009

With so much buzz around the office about PhoneGap, I figured I would chime in too, call it a spite driven blog post.

Last week I decided to add some sugar to XUI our answer to a light weight JavaScript framework. Since XUI really doesn’t need any new functionality it is really about progressively enhancing the existing code and project.

One area of the code I felt was particularly lacking was how XUI dealt with FORMS, and specifically how we could make XHR handle forms automatically. So lets start by looking at an example of how it worked before.

// This will insert data.html into #some_div
$('#some_div').xhr('/data.html');

When this code runs, it will see that the XHR function has no options, and send the resulting responseText back to the DIV (blowing out the existing content – innerHTML)

$('#some_div').xhr('/data.html', function() { alert("XHR Fired"); });
By making a simple change and passing in a function as the second parameter, you get the responseText back in the callback, this circumvents the responseText from being passing back to the calling node, making it arbitrary.

$('#some_form').xhr(function() { alert("XHR Fired"); });

<form id='some_form' action='/data.html' method='post'>
<input type='text' name='foo' value='bar' />
</form>

With the new changes from my last commit you now have both. In this case, the XHR function checks to see if node is a form, and then uses that data to construct the XHR request, action, method and form properties are all taken into account. Once the XHR has completed, it will call the callback function.

To learn more about XUI visit XUI
Check out the code here http://github.com/silentrob/xui

Thanks.

Posted in Development, Uncategorized | No Comments » | Add to Delicious | Digg It

Jistik CRE | January 22nd, 2008

Nitobi designs and builds a lot of projects that are featured on Ajaxian or getting some spotlight attention like Robot Replay or Jiibe, however thats not always the case.

Jistik, a subsidiary of Blackline Technologies Inc., had contacted Nitobi to developer a comprehensive Chargeback Recovery Environment CRE. This full featured web 2 application includes standard Nitobi components like Grid, Calendar and Call Out, however almost all are heavily modified. Before I explain how this system works, let break down what a chargeback is.

Chargebacks occur when a retailer sends an item back from the store to the manufacture or wherever it came. This could happen for a number of reasons, the items arrived damaged or in the wrong color, or the customer returns it for whatever reason.

jistik_s1.jpg

Chargeback data is imported into the CRE though a variety of formats, XML, CIT or GMAC and once the data arrives it is filtered down by the customer that sent it, and allocated to a collector or admin within the CRE to act on it. Chargebacks are ordered by recovery weight, this is a algorithm that determines the most likely to recover based on a series of configurable variables like recover amount, age, and reason and floats them up to the top of the grid. A collector can process a single chargeback or group several together and process the entire batch.

Each chargeback reason has a separate workbook and process outlined to complete it. A chargeback or batch is complete when it is determined valid and a settlement amount is negotiated or invalid and written off.

jistik_s2.jpg

The system supports various types of filtering and sorting along with a comprehensive reporting system for tracking just about everything.

From a design standpoint some of the challenges we faced were over engineering the the data structure based on some assumptions about the input data format. These assumptions turned out to be false and broke our rigid data model.

Another neat design feature we implemented is almost all of the xhr requests are funneled though a client side caching engine and routed though to a rendering template which draws or renders the markup, this application truly gets faster over time as once all of the data is fetched only updates sent back to the server.

 

The application is developed using PHP on top of the Codeigniter MVC engine with MySQL as the primary storage engine.

 

Posted in general | No Comments » | Add to Delicious | Digg It


Search Posts

Archives

Categories

  • Blogroll