55143681 Posted August 5, 2021 Share Posted August 5, 2021 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(\"序号\")"); Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 5, 2021 Share Posted August 5, 2021 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; } } Quote Link to comment Share on other sites More sharing options...
55143681 Posted August 11, 2021 Author Share Posted August 11, 2021 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.