웹 보고서 중 하나에서 JavaScript 메소드를 호출하는 리본 버튼이 있어야합니다.
에서 CommandDefinition
Ribbondiff XML 중 하위 그리드에 선택한 레코드의 모든 ID가 포함 된 JS 메소드로 매개 변수를 보내야합니다.
<CommandDefinitions>
<CommandDefinition Id="xyz.Button.SendEmail.command">
<EnableRules>
</EnableRules>
<DisplayRules>
</DisplayRules>
<Actions>
<JavaScriptFunction Library="$webresource:Test.Js" FunctionName="SendEmail">
<CrmParameter Value="SelectedControlAllItemIds" />
</JavaScriptFunction>
</Actions>
</CommandDefinition>
그러면 JS 메소드는 아래와 같은 것이며 모든 ID를 구문 분석 한 다음 논리를 처리해야합니다.
function SendEmail(selectedIds) {
if (selectedIds != null && selectedIds != “”) {
var strIds = selectedIds.toString();
var arrIds = strIds.split(“, ”);
for (var indxIds = 0; indxIds < arrIds.length; indxIds++) {
//The logic that you want to process on each record will come here.
}
} else {
alert(“No records selected !! !”);
}
}