GridJs için formül açıklaması göster
Contents
[
Hide
]
Formül içeren belirli bir hücrenin üzerine gelindiğinde formül açıklamasını göstermek için adımlar
Yükleme seçeneklerini ayarla.
örneğin:
const option = {
...
//set showFormulaExplain to true
showFormulaExplain:true,
};
xs = x_spreadsheet('#gridjs-demo', option)
showFormulaExplain için işlem URL’sini ayarla.
örneğin:
const formulaExplainUrl = "/GridJs2/FormulaExplain";
xs.setFormulaExplainUrl(formulaExplainUrl);
Kullanıcı bir formülü içeren hücre üzerinde fareyi hareket ettirdiğinde, formül açıklaması gösterme işlemi aktarım tablosu uygulaması tarafından otomatik olarak tetiklenecektir.
Sunucudaki Controller’da göster formül açıklaması eylem API’sini uygulayın.
örneğin:
[HttpPost]
public async Task<IActionResult> FormulaExplainAsync()
{
String formulaText = HttpContext.Request.Form["v"];
String locale = HttpContext.Request.Form["locale"];
if (string.IsNullOrEmpty(formulaText))
{
return Ok(new
{
Success = false,
v = ""
});
}
//here the formulaText is the formula ,etc "=SUM(B1:B10)"
string correctedContent = await GetFormulaExplainAsync(formulaText, locale);
return Ok(new
{
Success = true,
v = correctedContent
});
}
//you need to implement it youself
private async Task<string> GetFormulaExplainAsync(string formulaText,string locale)
{ String result=null;
//your logic to get the detail explanation for the formulaText
return result;
}