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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...