Jump to content

UniDBGrid:How to add title to the first "serial no" column?


55143681

Recommended Posts

If you set UniDBGrid->Options->dgRowNumbers to true,

then UniDBGrid's first column will be serial no  just like "1  2  3  4 .....",

but this column does not have title,

as you know, in delphi I can do that with this code:

  UniSession.AddJS(Self.Name+'.UniDBGrid1.columnManager.columns[0].setText("序号")');

but ,How to write the code in cbuilder?The follow code will give me some error:

UniSession->AddJS(this->Name+"->UniDBGrid1->columnManager->columns[0]->setText(\"序号\")");

Link to comment
Share on other sites

39 minutes ago, 55143681 said:

as you know, in delphi I can do that with this code:

  UniSession.AddJS(Self.Name+'.UniDBGrid1.columnManager.columns[0].setText("序号")');

but ,How to write the code in cbuilder?The follow code will give me some error:

UniSession->AddJS(this->Name+"->UniDBGrid1->columnManager->columns[0]->setText(\"序号\")");

Hello,

Also try this:

function beforereconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    if (columns[0].xtype && columns[0].xtype == 'rownumberer') 
    {
        columns[0].text = '序号';
        columns[0].width = 100;
    }
}

 

Link to comment
Share on other sites

On 8/5/2021 at 9:13 AM, Sherzod said:

Hello,

Also try this:


function beforereconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    if (columns[0].xtype && columns[0].xtype == 'rownumberer') 
    {
        columns[0].text = '序号';
        columns[0].width = 100;
    }
}

 

Thank you very much!

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...