tappatappa Posted January 30, 2018 Share Posted January 30, 2018 Hi, I am trying to set a DBGrid EmptyText at run time, if(MainDBGrid->EmptyText.IsEmpty()) { MainDBGrid->EmptyText = "NO RECORD"; } MainQuery->Open(); but I get this Ajax error message O553.applyEmptyText is not a function I also tried to inject javascript directly, but the result is the same UniSession->AddJS(UnicodeString().sprintf(L"%s.emptyText = '%s'; %s.applyEmptyText();", MainDBGrid->JSName, UnicodeString(L"NO RECORD"), MainDBGrid->JSName); Link to comment Share on other sites More sharing options...
Sherzod Posted January 30, 2018 Share Posted January 30, 2018 Hi, We will check this issue, Can you try to use this approach for now, for example ?!: UniDBGrid1.JSInterface.JSCall('setEmptyText', ['Empty']); Or like in this post: http://forums.unigui.com/index.php?/topic/3635-messages-on-empty-dbgrid/&do=findComment&comment=17581 Best regards, Link to comment Share on other sites More sharing options...
tappatappa Posted January 30, 2018 Author Share Posted January 30, 2018 I got O553.setEmptyText is not a function the other approarch you suggest seems to work, thanks! Edit: here is the code that I am using right now if(!_empty_txt_set) { UniSession()->AddJS(UnicodeString().sprintf(L"%s.view.emptyText='<div class=\"x-grid-empty\">NO RESULT</div>';%s.getView().refresh();", grid->JSName, grid->JSName); _empty_txt_set = true; } so it uses the same div class as a EmptyText.I had to use a boolean because the Server side uniDBGrid still has an empty EmptyText. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now