I want to show date in dd/mm/yyyy format but it always shows mm/dd/yyyy format. Also I want to set a default date to my control on page load
My view has:
<div class="col-md-4 col-sm-4 ">
@(Html.Infragistics().DatePicker()
.ID("TDate")
.ButtonType(TextEditorButtonType.DropDown)
.Render())
<input type="hidden" value="@ViewBag.TDate" id="hdnFlag" name="hdnFlag" />
</div>
My controller has :
public ActionResult Index()
{
ViewBag.TDate = "16-MAR-2017";
return View();
}
My javascript to set the default value is:
$(document).ready(function () {
var h1 = document.getElementById('hdnFlag');
if (h1 != null) {
h1 = h1.value.replace("-", " ");
h1 = h1.split("-").join(" ");
var twd = new Date(h1);
twd.toLocaleDateString("en-GB");
var d = twd.getDate();
var m = twd.getMonth();
var y = twd.getFullYear();
$("#TDate").igDatePicker({
value: new Date(y, m, d),
dateDisplayFormat: "dd/MM/yyyy",
minValue: new Date(y - 1, m, d)
})
});
I am not able to set the date correctly also if I change the date it shows in mm/dd/yyyy format.
Can anyone please help?
Regards
Singh
Hello Singh,
Can you please create a new topic about this issue in the 'igHierarchicalGrid' section of the forums -> https://es.infragistics.com/community/forums/589.aspx
The team that is working on the igGrid will assist you and will provide you the best solution for your project.
Best regards,Alexander
Thanks Alex
I have one more similar issue
I have a hierarchical grid and I am saving changes in the child level grid. The child level grid has 2 dropdowns and 1 free text box .
If one of the dropdowns is changed I want to check if either of the other 2 controls have been changed or not. If not then I have to show a message box and highlight those controls.
I am able to find out pending transactions on the child level and find out if 1 dropdown is changed then others are missing or not and show the message but not able to highlight the dropdown and free text box which are missing in the pending transactions array:
var childrenTransactions = grid.igHierarchicalGrid("allChildren");
var pendingTrans = childrenTransactions.igGrid("pendingTransactions")
I am able to iterate through the pending transactions array using the above code.
Can you please suggest something?
I am glad that it helped you with your scenario!
Best regards,Alex
Thank you Alex
It works now!
Can you please try using the following:
$(".ui-igedit-container").css("border-color", "red")
Please, let me know if this does the work for you!
Regards, Alexander