New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Title name of a field in a Dialog at runtime #941
Comments
Do you mean on the dialog or the grid? And do you mean the title of the dialog or grid, or a property field on the dialog or grid?
For property fields on the grid, decorate the property field whose column name you want changed with a // ....
public class ProductColumns
{
[DisplayName("Product Internal Name")]
public string ProductName { get; set; }
// ....
} You can do the same thing for property fields on the XYZEntityForm.cs class as well to change the label for fields on a dialog form. |
Hey man ! I mean the title of a Dialog. These step you told about is changing the title before the runtime. So, the title will be static. To change, I need to set the DisplayName property, build and run again. I need to change the dialog field title during the runtime, when my user is editing the data. Why? Here in Brazil we have 2 kind of ID: Personal ID (eg CPF), and Business ID (eg CNPJ). |
Dialog has a dialogTitle property. Best place to set it is in updateTitle method of entity dialog. |
It's not working.. I tried and one idea that i have is how to get the id field at client side in run time (eg BELECH_Gestao_ClientesDialog10_NomeAbreviado) |
What are you doing there. I said dialogTitle, not getGridField etc. |
If you mean change title of field, this.form.RazaoSocial.getGridField().find('.caption').text('asdadasd') |
=) Almost close !!! So, the command above worked when the caption field is not a required field
but, if the caption is a required field, the command above not working well, because he will erase the "*" (signal of required field). So, in these case to change the title of required field, the command below works good :
Thanks @jsbUSMC and @volkanceylan for your time and patience! |
PS.: For some reason, In typescript, String.Replace only replaces first occurrence of matched string. So, I used the function split(oldtext).join(newtext) |
Hi all, I have made a WIKI article out of this with a generic solution which does not need a hard-coded "old value". Hope this helps someone. With kind regards, John |
Hey
how can I change a title of a field (eg Product Name to Product Internal Name) at runtime?.
I tried to get the field with jquery, but without succes.
and tried with this.form.field.getGridField() and this.form.field.element.closest(".field"), without success too.
The text was updated successfully, but these errors were encountered: