Added field_loop to output of Thingy's www_getThingViaAjax method
This commit is contained in:
parent
4bcf12da02
commit
1378ab0d41
2 changed files with 10 additions and 0 deletions
|
|
@ -2308,6 +2308,15 @@ sub www_getThingViaAjax {
|
|||
return $session->privilege->insufficient() unless $self->canViewThing($thingId,
|
||||
$thingProperties->{groupIdView});
|
||||
|
||||
my @field_loop;
|
||||
my $fields = $session->db->read('select * from Thingy_fields where assetId=? and thingId=? order by sequenceNumber'
|
||||
,[$self->getId,$thingId]);
|
||||
while (my $field = $fields->hashRef) {
|
||||
$field->{formElement} = $self->getFormElement($field);
|
||||
push(@field_loop,$field);
|
||||
}
|
||||
$thingProperties->{field_loop} = \@field_loop;
|
||||
|
||||
$session->http->setMimeType("application/json");
|
||||
return JSON->new->utf8->encode($thingProperties);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue