Skip to main content

Posts

Showing posts from December, 2014

kendo ui datetimepicker to C# converting value

Get value entity.ExpiredDate = ParseDate(model.ExpiredDate); private static DateTime ParseDate(string input) { return DateTime.ParseExact(input, formats, CultureInfo.InvariantCulture, DateTimeStyles.None); } private static string[] formats = new string[] { "MM/dd/yyyy HH:mm:ss tt", "MM/dd/yyyy HH:mm:ss", "M/dd/yyyy H:mm:ss tt", "M/dd/yyyy H:mm:ss" , "MM/dd/yyyy hh:mm tt" }; Set Value viewModel.ExpiredDate = entity.ExpiredDate.ToString("MM/dd/yyyy hh:mm tt", CultureInfo.InvariantCulture);

kendo ui grid template if else

Use if else condition in kendo  UI template <script type="text/x-kendo-template" id="template"> <div id="details-container"> <dt> Name:</dt> #= Name # <br> <dt>Selected Device: </dt> iOS:-# if (PushToiOS == true) { #Yes# } else { #No# } #, Android:-# if (PushToAndroid == true) { #Yes# } else { #No# } #, WP:-# if (PushToWP == true) { #Yes# } else { #No# } # <br> <dt>Expire Date:</dt> #= kendo.toString(ExpiredDate, "MM/dd/yyyy") # <br> </div> </script>

Javascript Yes / No confirm dialog

You can see this function Remove(ctrl) { if (confirm('Pressing OK will delete this record. Do you want to continue?') == false) { return false; } var row = $(ctrl).parent().parent().parent().children().index($(ctrl).parent().parent()); // alert(row); $("#refRowIndex").val(row); var form = $("#frmStudentDetails"); var serializedForm = form.serialize(); var url = "/Student/RemoveStudentDetails"; $.post(url, serializedForm, function (result) { $("#divStudentDetails").html(result); }, "html"); return false; }

Custome command in kendo UI Grid toolbar

toolbar: [ { name: "Add", text: "Make Passive 3 Times Unsuccesful Ones", click: function (e) { console.log("foo"); return false; } } ], in the grid script $(".k-grid-Add", "#DefaultGrid").bind("click", function (ev) { $.ajax({ type: "POST", url: "http://localhost/Notifier/Devices/MakePassive/model", contentType: "application/json; charset=utf-8", dataType: "json", async: false, success: function (data) { //ev.success(); if (data.ResponseCode == 800) { ev.success(); } else { alert(data.ResponseMessa

kendoDropDownList json datasource

if you want to load your kendoDropDownList  from json we service you can follow this script $('#Branchs').kendoDropDownList({ // optionLabel: "Select branch...", dataTextField: "text", dataValueField: "value", change: function () { e.model.BranchRef = this.text(); }, dataSource: { transport: { read: function (e) { $.ajax({ url: 'http://localhost/Notifier/Branches/GetDropDown/token', type: 'GET', dataType: 'json', success: function (data) { { e.success(data);

How do you add a user in TFS 2012

Just follow the image. Now select user for your tfs member & press ok, you will get all the user in member assign in the browser.