SharePoint 2013でカスタムフィールドを開発しています。
クライアントサイドレンダリングで、NewFormのレンダリング時に、カスタムプロパティを取得したいと思っています。
以下、postRenderHander関数内でフィールドのカスタムプロパティを取得したいです。
var Field = ctx.ListSchema.Field[0];
にてFieldは取得できたのですがカスタムプロパティを参照するプロパティ値がわからず苦戦しております。
フィールドのSchemaXmlが取れるとベストなのですが…。
知恵をお貸しください。
よろしくお願いします。
JavaScript
1(function () { 2 var fileAttachmentContext = {}; 3 4 fileAttachmentContext.Templates = {}; 5 fileAttachmentContext.RenderingPatten; 6 fileAttachmentContext.Templates.Fields = { 7 "fileAttachment": { 8 "NewForm": fileAttachmentEditTemplate, 9 "EditForm": fileAttachmentEditTemplate, 10 "DisplayForm": fileAttachmentDisplayTemplate 11 } 12 }; 13 fileAttachmentContext.OnPostRender = postRenderHander; 14 15 SPClientTemplates.TemplateManager.RegisterTemplateOverrides(fileAttachmentContext); 16})(); 17 18function fileAttachmentEditTemplate(ctx) { 19 //省略 20} 21 22function fileAttachmentDisplayTemplate(ctx) { 23 //省略 24} 25 26function postRenderHander(ctx) { 27 var ctlMode = ctx.ControlMode; 28 switch (ctlMode){ 29 case 3: 30 //ここでカスタムプロパティを取得したい 31 fileAttachmentFieldInit(ctx); 32 break; 33 } 34} 35 36function urlInputEditTemplate() { 37 return ""; 38} 39 40function urlInputDisplayTemplate() { 41 return ""; 42}
あなたの回答
tips
プレビュー