Adding jquery listener for iframe content

StuartProgramming Blog

I have a solution that generates or downloads content, HTML formats it and pushes it into a dynamically generated iframe. Since the content is mostly forms, I need to know when the generated content is changed by a user. In this application, the following works fine for the first generated form: var iframe = element.find('iframe'); $(iframe.get(0).contentDocument).on('focusout', function (eventObject) { $(this).find("input,select,textarea").each(function … Read More

StuartAdding jquery listener for iframe content

Special row styling in JQGrid

StuartProgramming Blog

I had a customer who needed to highlight a row in their JQGrid when certain parameters are met. It turns out for the static table data they were using this is very simple. Just add a new handler to the JQGrid constructor that specified afterInsertRow behavior. afterInsertRow: function(rowID, rowData, rowElement) { if (rowData.onbasehandlerelated!=""){ $("#"+ rowData,jQuery('#receiptdatatable')).removeClass('ui-widget-content'); $("#"+ rowData,jQuery('#receiptdatatable')).addClass('ui-state-error'); } }, Here … Read More

StuartSpecial row styling in JQGrid

JQueryUI Autocomplete Search from Beginning

StuartProgramming Blog

I love the integrated Autocomplete in the JQueryUI but I have gotten requests to change the search behavior. The default behavior is to search for the target value anywhere in the string of the values supplied. This works natively by using something like the following code: var matcher = new RegExp( term.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), "i" ); return $.grep( array, function(value) { … Read More

StuartJQueryUI Autocomplete Search from Beginning