Page 1 of 1

join() function in helper library?

Posted: 2021-01-27 12:29
by eagle
Is the join() function implemented in the current helper library?

I have been trying to follow https://appgini.bizzworxx.de/appgini/hi ... w-columns/ but I can not get it to work.

I have created the file tablename-tv.js and inserted this

Code: Select all

jQuery(document).ready(function() {
  var tv = AppGiniHelper.TV;
  .join("description", ["consequence", "probability"], "Heading");
});
but nothing seems to happen...

Thanks for all help!

Re: join() function in helper library?

Posted: 2021-01-27 12:42
by jsetzer
Yes, it is included in latest version for testing purposes.

Default

chrome_2CY4F0nOVG.png
chrome_2CY4F0nOVG.png (3.79 KiB) Viewed 4921 times

Code

Code: Select all

// file: hooks/TABLENAME-tv.js
jQuery(document).ready(function () {
    AppGiniHelper.TV.join("CustomerID", ["CompanyName", "ContactName"], "Joined Column", true)
});
Joined

chrome_R3FHnlvrEH.png
chrome_R3FHnlvrEH.png (5.81 KiB) Viewed 4921 times

Re: join() function in helper library?

Posted: 2021-01-27 12:47
by jsetzer
var tv = AppGiniHelper.TV;
.join("description", ["consequence", "probability"], "Heading");
There is a syntax error in your code between TV; and .join.

It has to be tv.join(...);

Recommendation

I strongly recommend using a modern code editor like Visual Studio Code (free) which will highlight errors while writing.

Code_GYkkoE62LS.png
Code_GYkkoE62LS.png (8.63 KiB) Viewed 4921 times

This will safe time... yours and also mine ;-)

Re: join() function in helper library?

Posted: 2021-02-15 13:25
by eagle
Thank for helping but I still can't get it to work.

This is my code:
a.png
a.png (7.27 KiB) Viewed 4864 times

And this is the result:
b.png
b.png (14.78 KiB) Viewed 4864 times
Don't know if this is enough to push me in the right direction, not nothing seems to change when using the code.

Thanks for all help.

Re: join() function in helper library?

Posted: 2021-02-15 14:20
by jsetzer
Did you clear browser cache?
Are there warnings or errors in console?
Any syntax errors highlighted in your code editor?

Can you please put a console.log("test"); immediately before that JOIN line and check that logging in console to ensure the code gets executed at all.

Re: join() function in helper library?

Posted: 2021-02-15 14:52
by eagle
> Did you clear browser cache?

Yes. Also tried different browsers.

> Are there warnings or errors in console?
d.png
d.png (27.9 KiB) Viewed 4854 times
> Any syntax errors highlighted in your code editor?
Not that I can see...
f.png
f.png (8.71 KiB) Viewed 4854 times
> Can you please put a console.log("test");
Done that now, but not sure where I would look for this output...

Re: join() function in helper library?

Posted: 2021-02-15 16:07
by onoehring
Hi,

you should see the output ("test") in the console window of which you made a screenshot in your posting (or course, the page needs to load and the code should be run).

Olaf

Re: join() function in helper library?

Posted: 2021-02-15 16:11
by jsetzer
After you have put the .log command before the line with the join command there should be log entry "test" in console output.

From your screenshots I can see three problems:

1) you did not put the console.log command immediately before the join line but before the .ready event.
2) there is no "test" output in console
3) there is a red error telling us there is an include missing

2nd issue tells me that your code for logging does not get executed. I guess this is because of the (red) error. The error is not caused by our library but by a missing language file for NL for your datepicker control.

I recommend fixing the error first and then continue working on the tv.join command. It should work after you have fixed predecessing javascript errors.

You can ignore the yellow warnings. only the red errors stop execution of subsequent commands.