Add text style

Questions related to using nuBuilder Forte.

Re: Add text style

Postby Janusz » Wed Feb 13, 2019 8:49 pm

Janusz
 
Posts: 260
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Add text style

Postby nac » Wed Feb 13, 2019 9:51 pm

Thanks Janusz,

It looks like the Trumbowyg editor is not getting the contents from the textarea object when the form is loaded. This then affects the saving.
It is difficult to investigate this with fragments of code; ideally one would look at the application interactively. Perhaps, as a start, could you paste the entire contents of the form's Custom Code>JavaScript in your reply (use the code tags) ?

BTW, I would not put this type of field in the Browse form unless needed for searching - it would not render as formatted text.

Neil
nac
 
Posts: 47
Joined: Wed Dec 13, 2017 7:58 am
Location: Aberdeen, UK

Re: Add text style

Postby Janusz » Wed Feb 13, 2019 10:18 pm

Neil,
Thank you very much for you involvement - I appreciate it very much.

In fact the server I am testing it now - is temporary one with no sensitive data on it (just one test table) so I can share the access.

Would it be possible for you to open the following and have a look?
Last edited by Janusz on Wed Feb 13, 2019 10:31 pm, edited 1 time in total.
Janusz
 
Posts: 260
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Add text style

Postby nac » Wed Feb 13, 2019 10:29 pm

Janusz,

Sure - I will have a look and see what I can do.
I have noted the credentials. If you wish, you can delete/edit them in the previous post. (Always best to be cautious about these things.)

Neil
nac
 
Posts: 47
Joined: Wed Dec 13, 2017 7:58 am
Location: Aberdeen, UK

Re: Add text style

Postby Janusz » Wed Feb 13, 2019 10:33 pm

Thanks,
and just updated the previous post.

Janusz
Janusz
 
Posts: 260
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Add text style

Postby nac » Wed Feb 13, 2019 10:41 pm

Janusz,

It is fixed. There was a name clash and so I changed the ID of the HTML object from "tre-field1" to 'field1_tre'. The div id="tre-field1" remains the same as before .

Neil
nac
 
Posts: 47
Joined: Wed Dec 13, 2017 7:58 am
Location: Aberdeen, UK

Re: Add text style

Postby nac » Wed Feb 13, 2019 11:02 pm

As a follow-up, the efficiency of the save operation can be improved by skipping the objects which have not been edited. Here is the modified function.

Code: Select all
function nuBeforeSave() {
var hcont;
var ocont;
treField.forEach(function(element) {
    hcont = $("#"+"tre-"+ element).trumbowyg('html');
    ocont = $("#"+element).val();
    if (hcont !== ocont) {
       $("#"+element).val(hcont).change();
    }   
  });   
return true;
}

N
nac
 
Posts: 47
Joined: Wed Dec 13, 2017 7:58 am
Location: Aberdeen, UK

Re: Add text style

Postby Janusz » Wed Feb 13, 2019 11:25 pm

Neil,
Yeah it's working !!! :-)

Really Thank you very very much for your involvement and help.

Janusz
Janusz
 
Posts: 260
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Add text style

Postby nac » Wed Feb 13, 2019 11:28 pm

Zapraszamy!
nac
 
Posts: 47
Joined: Wed Dec 13, 2017 7:58 am
Location: Aberdeen, UK

Re: Add text style

Postby Janusz » Wed Feb 13, 2019 11:42 pm

Dziękuję Bardzo - i zapraszam na piwo jak będziesz w Krakowie.

Janusz
Janusz
 
Posts: 260
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

PreviousNext

Return to General



cron