Aug 12, 2015, 8:38 AM
Checking TabPanel Items In Server - Side (Example)
Hi Guys
I was asked that question
This trick,related above my question.
How to check TabPanelItems in server-side. ?
I have tried in server-side methods.
Method 1 (not worked)
Working Method.
I was asked that question
This trick,related above my question.
How to check TabPanelItems in server-side. ?
I have tried in server-side methods.
Method 1 (not worked)
TabPanel tabPanel = X.GetCmp<TabPanel>("tabContainer");
if (tabPanel.FindControl("tab1") != null) // always working
{
//to do
}
Method 2 (not worked)TabPanel tabPanel = X.GetCmp<TabPanel>("tabContainer");
Panel tab1= X.GetCmp<Panel>("tab1"); // always working...
if (tab1!=null)
{
// to do
}
Working Method.
treePanel.DirectEvents.ItemClick.Before = "o.extraParams.param1 = record.data.id; o.extraParams.param2 = record.data.text; var tagId = record.raw['tag']; o.extraParams.param3 = tagId; var tab = App.tabContainer.getComponent('Id'+tagId); var result = false; if (tab) { result = true; } else { result = false; } o.extraParams.tabIsExist=result; ";
public class MenuController : Controller
{
public ActionResult TreePanelClickHandler(string param1,string param2,string param3,bool tabIsExist)
{
if (tabIsExist)
{
// todo
}
X.Msg.Alert("server-side:", param1 + "\n" + param2+ "\n" + param3).Show();
AjaxResult r = new AjaxResult();
return r;
}
}
Last edited by ismailkocacan; Aug 12, 2015 at 8:42 AM.