I have this function and not quite sure how to optimize it?
function _onReadBtnClick(ctx) {
var data = ctx.props.data;
// Module Window -- Form Input Values
$(".modal-title").text("Intranet Module");
$("#cBalModel").modal();
$("#mBalDate").val(data.BalanceingDate);
$("#mStoreCode").val(data.StoreCode);
$("#mSubmittedBy").val(data.SubmittedBy);
$("#mCustCode").val(data.CustomerCode);
$("#mTicketSO").val(data.Ticket_SO);
$("#mDollarAmt").val(data.DollarAmount);
$("#mKeyedIn").val(data.KeyInAs);
$("#mShouldBeIn").val(data.ShouldBe);
$("#mAdditionalInfo").val(data.AdditionalInfo);
};
$("#cBalModel").modal();
after you changed all the text values. This will reduce the number of reflows to 1, instead of many. \$\endgroup\$ctx
? What isdata
inctx
? \$\endgroup\$