> Am 06.02.2018 um 11:45 schrieb Virginia Mesa <[email protected]>: > > Hi, > Look,this is the Java method: > > <Auto Generated Inline Image 1.png> > Text would be preferred :-(
> The method returns an array of string, does it always return a JSON?
I don’t know if Jenkins does convert the array of strings into a JSON object.
But you will see the returned data structure in your browsers debugger.
I converted it in my views manually. My signature looks like
@JavaScriptMethod
public JSONObject getTableModel() {
return JSONObject.fromObject(new
IssuesTableModel().toJsonArray(getIssues()));
}
In the jelly file I am working with the JSON object in JS:
<script>
…
view.getTableModel(function(t) {
(function ($) {
var table = $('#warnings').DataTable();
table.rows.add(t.responseObject().data).draw()
})(jQuery);
})
</script>
>
> What happens is that then I use that array to fill a table, so I need it to
> be an array to go through it like this:
>
> <Auto Generated Inline Image 2.png>
>
>
> To that variable 'orderOfcomps', I want to give it the value of the array to
> be able to traverse it, and in this way I would already have it.
>
You can’t use jelly expressions here, this needs to be done in JS.
> Thank you very much again, I hope I do not cause you much trouble.
>
> A greeting.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/296aa94d-a93d-4181-ae0b-046465b64cc2%40googlegroups.com
>
> <https://groups.google.com/d/msgid/jenkinsci-dev/296aa94d-a93d-4181-ae0b-046465b64cc2%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
> <Auto Generated Inline Image 1.png><Auto Generated Inline Image 2.png>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/C90936EC-9F4E-4784-B094-77C0E3F1012A%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: Message signed with OpenPGP
