Jump to content

applyEmptyText is not a function


tappatappa

Recommended Posts

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...