WebSite X5Help Center

 
Sinisa B.
Sinisa B.
User

Database viewer - column names (labels)  en

Autor: Sinisa B.
Visitado 450, Seguidores 1, Compartilhado 0  

Hi All,

I am filling the database via a form (OPTION: send to database).
I am using the DATABASE VIEWER object to show the collected data.

Due to the FORM field rules, the database field name cannot contain SPACE (cannot use two or more words as a field name). Thus in the table view of the DATABASE VIEWER, the column name (aka column label) is shown as SINGLE WORD without spaces between words (see below).


I know that in PHPMyAdmin I can change the names of the columns of the database table and thus have two or more words in a column, but then I cannot fill in the data via the form because it will add columns of different names (no space names).

I also know that I can directly enter data using the DATABASE VIEWER and that the above (form) problem could be avoided, but I have to enter data via the form for legal reasons!

So, my question is:
Is there a way to use FORM (send to database option) to fill the database so that in the Database Viewer column names (column labels) could have two or more words separated by a space?
I would like to avoid the underscore "_" charater as a separator...

Thank you in advance for your help!

Publicado em
11 RESPOSTAS - 3 ÚTEIS
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator

(It > En)  ...if you can't find any other solutions, and just to improve the visual appearance on the monitor, if you post the link to the page in question, some of my dynamic JavaScript code could be considered; otherwise, ignore my post, as if I hadn't said anything...

.

ciao

.

Ler mais
Publicado em de  ‪ KolAsim ‪ ‪
Daniel W.
Daniel W.
User
Usuário do mês DEUsuário do mês EN

The words could be visually separated by the character _

Serijki_Broj_Racunala

Windows_Lozinka

Windows_Pin

Ler mais
Publicado em de Daniel W.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator

... he wanted to avoid it because it was unsightly, ... but it is possible to use the underscore "_" to separate words, and then with my EXTRA(!) code show the normal words, without the hyphen...

.

ciao

.

Ler mais
Publicado em de  ‪ KolAsim ‪ ‪
Sinisa B.
Sinisa B.
User
Autor


@KolAsim & @Daniel 

Thank you! Pls. read below


Yes, I know I can use "_" to "visually" separate words, but I would like that "_" not to be visible in the Database viewer table.

@KolAsim - If you could give me your PM, so I can send you the link and user name/password?

So, the problem is:
How to input data via FORM, so that in the Database viewer shows column names separated?

For example:

If I have a data field in a form, WindowsPassword, I want to be able to display it in the Database viewer column as two words separated by "SPACE", Windows Password.

I could use "_" in the database field name as a "separation marker" between the two words—no problem.

So, it's purely a visual representation, not a change in the name of the field in the database...

Thank you!

Ler mais
Publicado em de Sinisa B.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator
Sinisa B.
... ... ... @KolAsim - If you could give me your PM, so I can send you the link and user name/password? ... ... ... 

... it's not possible, but you can do it anyway with this procedure...
... separate the words with an underscore "_"...
... for the test, you could use a temporary user, which you'll then delete immediately after the test...
... for example:
user: pippo(At)xx.yy ... (At) instead of @ because the email wouldn't be visible here...
pass: 1234
...
... or you can use my invention yourself if you determine the reference selector of your form for the variable objK:

<script>
$( document ).ready(function() { //K>
setTimeout(function(){
objK =$( ".jtable-column-header span " );
for(var i = 0, TotK = objK.length; i < TotK; i++){ //K1>
var strK = $(objK[i]).text();
var strK = strK.split('_').join(' ');
$(objK[i]).text(strK);
} //K1<<
},3000);
}) //K<<
</script>

.

ciao

.

Ler mais
Publicado em de  ‪ KolAsim ‪ ‪
Sinisa B.
Sinisa B.
User
Autor

@ KolAsim ‪ ‪

Thank you very much!

OK-I'll use "_" in the FORM's database field names.

Could you write me here some instructions on where I should put your script and what script editing is needed to work as I want?

Just to repeat the goal here:

To display column titles (form's data fields) as separate words if they contain more than one word via the Database viewer object.


KolAsim, thank you in advance!

 

Ler mais
Publicado em de Sinisa B.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator

... write the names like this:

Serijski_Brogj_Racumala
Windows_Lozinka
Windows_PIN

... my code will replace the "_" with a blank " "

Serijski Brogj Racumala
Windows Lozinka
Windows PIN

... ... ... 

... Right-click on the column name and find the class...
... the class name, if different from mine, replace it in my code in the first variable objK...

.

Ler mais
Publicado em de  ‪ KolAsim ‪ ‪
Sinisa B.
Sinisa B.
User
Autor

@KolAsim

Thank you very much for your effort!

I'll try it today and let you know!

Best!

Ler mais
Publicado em de Sinisa B.
Sinisa B.
Sinisa B.
User
Autor

@KolAsim

It works as it should - the class name was the same as the one in your example.

Again, KolAsim - thank you very much for your help!

Ler mais
Publicado em de Sinisa B.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator

... OK ... ciao

.

Ler mais
Publicado em de  ‪ KolAsim ‪ ‪