0

I have used JSLink to customize New, Edit and view form. Facing intermittent issue with OOTB date field. When I selects date field some times it is not closing calendar popup. I'm using IE 11.

(function () {
document.write('<link rel="Stylesheet" type="text/css" href="../../SiteAssets/test.css" />');

var formTemplate = {};
formTemplate.Templates = {};
formTemplate.Templates.View = TestNewFormView;
formTemplate.Templates.OnPostRender = loadNewDocument;
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(formTemplate);

})();


function TestNewFormView(ctx) {
var FormTable = "".concat("<div class=''>",
    "<td class='ms-formlabel'><div>{{HODatereceived}}</div></td>",
)

FormTable = NBPropFormTable.replace('{{HODatereceived}}', getSPFieldRender(ctx, 'HODatereceived'));
}

function getSPFieldRender(ctx, fieldName) {
try {
    var fieldContext = ctx;

    var result = ctx.ListSchema.Field.filter(function (obj) {
        return obj.Name == fieldName;
    });

    fieldContext.CurrentFieldSchema = result[0];
    fieldContext.CurrentFieldValue = ctx.ListData.Items[0][fieldName];
    return ctx.Templates.Fields[fieldName](fieldContext);
}

catch (ex) {
}
}
  • Could you provide detail information about your JSLink? – Julie_MSFT Mar 17 at 7:12
  • We have customized new, edit and view form using JSLink nothing fancy just the alignments and some business logic. We haven't customized SharePoint Date picker. – Vijay Mar 17 at 12:40
  • I you need assistance troubleshooting your JSLink, there is not much that can be done unless you include your JSLink Code in your question (or a link to hosted code repository). – willman Mar 17 at 15:26
  • Hi williman, I have included my sample code. "HODateReceived" is the date field where I'm facing this intermittent issue. – Vijay Mar 17 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.