delayTAbFocus($("#txtContractID"));
   delayTAbFocus($("#txtAddress1"));
   
    
    function delayTAbFocus(target) {
         //hach for ie7
        target.live('keydown', function(e) {
            var keyCode = e.keyCode || e.which;

            if (keyCode == 9) {
                //e.preventDefault();
               var ind = target.attr("tabindex") + 1;
                for (var i = ind; i < 100; i++) {
                    var nextTarget = $('input[tabindex=' + ind + ']');
                    if (nextTarget != null && nextTarget.is(':visible') && nextTarget.is(':enabled')) {
                        target.closest("form").focus();
                        setTimeout(function() { $('input[tabindex=' + ind + ']').focus(); }, 100);
                        break;
                    };
                }

            }
        });
    }

My solution is when Tab keydown, focus the current form1 again, then find the next tabindex.
in this code, I have set all tabindex in no interval sequence..


 
Categories: JQuery

1. add data-bind attribution to your dropdown

     @Html.DropDownListFor(m => m.SelectCafeBuildVersion, Model.AutoDaploymentData.CafeBuildVersions, "", 
new
 { @class = "", @data_bind = "options: cafeBuildVersions,optionsText: 'Text',optionsValue:'Value'" })       
Notce here is "@data_bind", it will change to "data-bind" in the HTML automatictly.


2. in the ajax Call get json object from backend, and add a a viewmode:

             $.ajax({
                type: "post",
                url: "MyController/RefreshModelData",
                success: function (model) {                   
                 var   viewModel = {
                        cafeBuildVersions: ko.observableArray(model.AutoDaploymentData.CafeBuildVersions)
                      )
                    };
                  ko.applyBindings(viewModel);
                
                },
                error: function (v) {
                    alert("data error!");
                   
                }
            });

That's it..

if not in ajax..you can get the modeldata from model do it in the View:
var modelData = @Html.Raw(Json.Encode(Model));
or
<script type="text/javascript">
    var initialData = <%= new JavaScriptSerializer().Serialize(Model) %>;
</script>


 
Categories: JQuery | MVC

http://www.rgraph.net/
RGraph is a HTML5 charts library that uses the HTML5 canvas tag to draw and supports over twenty different types of charts. Using the new HTML5 canvas tag, RGraph creates these charts inside the web browser using JavaScript, meaning quicker pages and less web server load. This leads to smaller page sizes, lower costs and faster websites.


 
Categories: Html5