
Quote from asmat on September 3, 2019, 11:38 amHow can I convert the following JSON to neotable in easy way?
myjson=[
{
"Id":1,
"Name":"nasir",
"Age":14
},
{
"Id":2,
"Name":"ali",
"Age":18
},
{
"Id":3,
"Name":"shamas",
"Age":15
},
{
"Id":4,
"Name":"kabir",
"Age":16
}
]Similarly,Is there any way to change directly HTML table to neotable?
example, How can I change the following html table to neotable?
<table>
<th>
<td>id</td>
<td>name</td>
<td>age</td>
</th>
<tr>
<td>1</td>
<td>kabir</td>
<td>17</td>
</tr>
<tr>
<td>2</td>
<td>shamas</td>
<td>16</td>
</tr>
<tr>
<td>3</td>
<td>ali</td>
<td>15</td>
</tr>
<tr>
<td>4</td>
<td>toli</td>
<td>20</td>
</tr>
</table>Regards.
How can I convert the following JSON to neotable in easy way?
myjson=[
{
"Id":1,
"Name":"nasir",
"Age":14
},
{
"Id":2,
"Name":"ali",
"Age":18
},
{
"Id":3,
"Name":"shamas",
"Age":15
},
{
"Id":4,
"Name":"kabir",
"Age":16
}
]
Similarly,
Is there any way to change directly HTML table to neotable?
example, How can I change the following html table to neotable?
<table>
<th>
<td>id</td>
<td>name</td>
<td>age</td>
</th>
<tr>
<td>1</td>
<td>kabir</td>
<td>17</td>
</tr>
<tr>
<td>2</td>
<td>shamas</td>
<td>16</td>
</tr>
<tr>
<td>3</td>
<td>ali</td>
<td>15</td>
</tr>
<tr>
<td>4</td>
<td>toli</td>
<td>20</td>
</tr>
</table>
Regards.

Quote from luishp on September 3, 2019, 12:09 pm@asmat try this for JSON data (add a Container first):
BeginJS $App.myjson=[ { "Id":1, "Name":"nasir", "Age":14 }, { "Id":2, "Name":"ali", "Age":18 }, { "Id":3, "Name":"shamas", "Age":15 }, { "Id":4, "Name":"kabir", "Age":16 } ] EndJS neoTableSetColumn "Container1" 1 "Id" "ID" "" false false false "" neoTableSetColumn "Container1" 2 "Name" "Name" "" false false false "" neoTableSetColumn "Container1" 3 "Age" "Age" "" false false false "" neoTableInitTable "Container1" "" 0 "Table" false false false false false "" neoTableLoadData "Container1" [myjson]It's not possible to convert directly an HTML table to a neoTable, you should extract the data first.
@asmat try this for JSON data (add a Container first):
BeginJS
$App.myjson=[
{
"Id":1,
"Name":"nasir",
"Age":14
},
{
"Id":2,
"Name":"ali",
"Age":18
},
{
"Id":3,
"Name":"shamas",
"Age":15
},
{
"Id":4,
"Name":"kabir",
"Age":16
}
]
EndJS
neoTableSetColumn "Container1" 1 "Id" "ID" "" false false false ""
neoTableSetColumn "Container1" 2 "Name" "Name" "" false false false ""
neoTableSetColumn "Container1" 3 "Age" "Age" "" false false false ""
neoTableInitTable "Container1" "" 0 "Table" false false false false false ""
neoTableLoadData "Container1" [myjson]
It's not possible to convert directly an HTML table to a neoTable, you should extract the data first.

Quote from asmat on September 5, 2019, 2:22 pmhello,
In above, I want whenever we click on any row table, the value of that row set in the textInputs?
how should I do this?
hello,
In above, I want whenever we click on any row table, the value of that row set in the textInputs?
how should I do this?
Quote from Gaev on September 5, 2019, 4:13 pm@asmat
I want whenever we click on any row table, the value of that row set in the textInputs?
how should I do this?You can find an example of this in the neoTable Tutorial Part I; in particular, look at ... Subrouties Page >>> SubroutinesLoadData Button >>>
... define user permissions neoTableInitTable "SubroutinesContainer" "" 5 "Table" true true true true false "eventManager">>> subroutine named eventManager >>>
If [neoTableEvent] == "click" SetVar [thisEventData] "[thisEventData][neoTableField]" StringifyJSON [neoTableRow] [neoTableRowString] SetVar [thisEventData] "[thisEventData]<br/>[neoTableRowString]" EndIfThe (reserved) variable called [neoTableRow] contains the Row Data of the row clicked by user ... it is in JSON format ... you can either extract individual key/value pairs or stringify it (as is done in the tutorial).
I want whenever we click on any row table, the value of that row set in the textInputs?
how should I do this?
You can find an example of this in the neoTable Tutorial Part I; in particular, look at ... Subrouties Page >>> SubroutinesLoadData Button >>>
... define user permissions neoTableInitTable "SubroutinesContainer" "" 5 "Table" true true true true false "eventManager"
>>> subroutine named eventManager >>>
If [neoTableEvent] == "click" SetVar [thisEventData] "[thisEventData][neoTableField]" StringifyJSON [neoTableRow] [neoTableRowString] SetVar [thisEventData] "[thisEventData]<br/>[neoTableRowString]" EndIf
The (reserved) variable called [neoTableRow] contains the Row Data of the row clicked by user ... it is in JSON format ... you can either extract individual key/value pairs or stringify it (as is done in the tutorial).


Quote from asmat on September 11, 2019, 4:01 pmHow can I convert the below json to neotable ?
LoadJSON "https://kankor-1c0a1.firebaseio.com/user.json" [source]
I have tried a way but it does not work, you can see it in the attachment,.
How can I convert the below json to neotable ?
LoadJSON "https://kankor-1c0a1.firebaseio.com/user.json" [source]
I have tried a way but it does not work, you can see it in the attachment,.
Uploaded files:
Quote from Gaev on September 11, 2019, 9:32 pm@asmat
1) when I click on the first PushButton, Chrome Debugger reports a Warning ...
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
send @ jquery.min.js:2... take a look at response by @luishp here ... https://visualneo.com/forum/topic/error ... for alternate method.
2) the file https://kankor-1c0a1.firebaseio.com/user.json looks like this ...
[{"Age":13,"Id":0,"Name":"kamar"},{"Age":14,"Id":1,"Name":"nasir"},{"Age":18,"Id":2,"Name":"ali"},{"Age":15,"Id":3,"Name":"shamas"},{"Age":16,"Id":4,"Name":"kabir"}]... so you do not need to stringify the data ... try and place the above JSON data in your TextArea and then click on the second button
3) your column definitions (field names) ...
neoTableSetColumn "mytable" 1 "id" "ID" "" false false false "" neoTableSetColumn "mytable" 2 "subject" "subject" "" false false false "" neoTableSetColumn "mytable" 3 "time" "time" "" false false false "" neoTableSetColumn "mytable" 4 "detail" "detail" "" false false false "" neoTableInitTable "mytable" "" 0 "Table" false false false false false ""... do not sync with the keys in your json file (Age, Id and Name)
1) when I click on the first PushButton, Chrome Debugger reports a Warning ...
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
send @ jquery.min.js:2
... take a look at response by @luishp here ... https://visualneo.com/forum/topic/error ... for alternate method.
2) the file https://kankor-1c0a1.firebaseio.com/user.json looks like this ...
[{"Age":13,"Id":0,"Name":"kamar"},{"Age":14,"Id":1,"Name":"nasir"},{"Age":18,"Id":2,"Name":"ali"},{"Age":15,"Id":3,"Name":"shamas"},{"Age":16,"Id":4,"Name":"kabir"}]
... so you do not need to stringify the data ... try and place the above JSON data in your TextArea and then click on the second button
3) your column definitions (field names) ...
neoTableSetColumn "mytable" 1 "id" "ID" "" false false false "" neoTableSetColumn "mytable" 2 "subject" "subject" "" false false false "" neoTableSetColumn "mytable" 3 "time" "time" "" false false false "" neoTableSetColumn "mytable" 4 "detail" "detail" "" false false false "" neoTableInitTable "mytable" "" 0 "Table" false false false false false ""
... do not sync with the keys in your json file (Age, Id and Name)

Quote from lesanch on June 21, 2021, 9:18 pmHi, @luishp, @Gaev,
Following this topic, can you provide me please some example or tell me where i can find an example about how to visualize in neotable the data obtained in json format from a query against a database ?. I saw some examples reading a locally o r remote Json file, in that case the data is already written there, but i need to show in neotable the data obtained from a query into [Data] variable through SetObjectHTML "Container1" [Data].
i received this in [Data]: [{"USERNAME":"TEST","ACCOUNT_STATUS":"OPEN"}]
Regards and thanks,
Sam
Following this topic, can you provide me please some example or tell me where i can find an example about how to visualize in neotable the data obtained in json format from a query against a database ?. I saw some examples reading a locally o r remote Json file, in that case the data is already written there, but i need to show in neotable the data obtained from a query into [Data] variable through SetObjectHTML "Container1" [Data].
i received this in [Data]: [{"USERNAME":"TEST","ACCOUNT_STATUS":"OPEN"}]
Regards and thanks,
Sam
Quote from Gaev on June 21, 2021, 10:34 pm@lesanch
i received this in [Data]: [{"USERNAME":"TEST","ACCOUNT_STATUS":"OPEN"}]
Looks like the data you have received is already in the correct format i.e. a one element (record) array of json key:value (field-name:field-value) pairs.
i need to show in neotable the data obtained from a query into [Data] variable through SetObjectHTML "Container1" [Data].
This is where I am unclear what you want to do (perhaps something is lost in translation).
a) Do you want to show this information in a neoTable View (perhaps a card view) ?
or
b) Do you want to format the result as the content of a Container object (albeit made pretty by using html/css) ?
Is there any way you can show how you want the end result to look like ?
i received this in [Data]: [{"USERNAME":"TEST","ACCOUNT_STATUS":"OPEN"}]
Looks like the data you have received is already in the correct format i.e. a one element (record) array of json key:value (field-name:field-value) pairs.
i need to show in neotable the data obtained from a query into [Data] variable through SetObjectHTML "Container1" [Data].
This is where I am unclear what you want to do (perhaps something is lost in translation).
a) Do you want to show this information in a neoTable View (perhaps a card view) ?
or
b) Do you want to format the result as the content of a Container object (albeit made pretty by using html/css) ?
Is there any way you can show how you want the end result to look like ?

Quote from lesanch on June 21, 2021, 11:03 pmHi @Gaev,
Sorry for my bad english, i just want to see this: [{"USERNAME":"TEST","ACCOUNT_STATUS":"OPEN"}]
like .jpg i attached done with paint :-).
Regards,
Sam
Hi @Gaev,
Sorry for my bad english, i just want to see this: [{"USERNAME":"TEST","ACCOUNT_STATUS":"OPEN"}]
like .jpg i attached done with paint :-).
Regards,
Sam
Uploaded files:
Quote from luishp on June 22, 2021, 12:52 pm@lesanch, this works for me:
.Create data CreateEmptyArray [Data] BeginJS $App.Data = [{"USERNAME":"TEST","ACCOUNT_STATUS":"OPEN"}] EndJS .Render data neoTableSetColumn "Container1" 1 "USERNAME" "User name" "" true false true "" neoTableSetColumn "Container1" 2 "ACCOUNT_STATUS" "Account Status" "" true false true "" neoTableInitTable "Container1" "es-ES" 0 "Table" true true true true false "" neoTableLoadData "Container1" [Data]Regards
@lesanch, this works for me:
.Create data
CreateEmptyArray [Data]
BeginJS
$App.Data = [{"USERNAME":"TEST","ACCOUNT_STATUS":"OPEN"}]
EndJS
.Render data
neoTableSetColumn "Container1" 1 "USERNAME" "User name" "" true false true ""
neoTableSetColumn "Container1" 2 "ACCOUNT_STATUS" "Account Status" "" true false true ""
neoTableInitTable "Container1" "es-ES" 0 "Table" true true true true false ""
neoTableLoadData "Container1" [Data]
Regards

Quote from lesanch on June 22, 2021, 11:50 pmLuis, mil perdones si no se entiende, tratare de explicarlo en español, básicamente es eso que dices, pero lo que no puedo lograr es pasar la variable [Data] conteniendo el json. Pongo un ejemplo con ese mismo código que pusiste para ver si puedo lograr explicarme un poco mejor.
Trataría de sacar el contenido de la variable [Data] del Container1 de este modo por ejemplo:
GetObjectHTML "Container1" [stat_usr]
después:
.Create data
CreateEmptyArray [Data]
BeginJS
$App.Data = [stat_usr]
EndJS
.Render data
neoTableSetColumn "Container1" 1 "USERNAME" "User name" "" true false true ""
neoTableSetColumn "Container1" 2 "ACCOUNT_STATUS" "Account Status" "" true false true ""
neoTableInitTable "Container1" "es-ES" 0 "Table" true true true true false ""
neoTableLoadData "Container1" [Data]Pero no me funciona. Lo otro que me esta pasando y no se si tiene que ver es que el contenido de la variable [Data] la consulta a la bbdd usando la función var_dump(json_encode($res)); ahora me lo esta retornando desde el PHP en este modo:
string(56) "{"USERNAME":"DIP","ACCOUNT_STATUS":"EXPIRED & LOCKED"}"
no sé si alguien ha tenido experiencia similar que me ayude a pasar lo anterior a:
[{"USERNAME":"DIP","ACCOUNT_STATUS":"EXPIRED & LOCKED"}]
Se que son dos temas pero por ahí uno depende del otro.
Regards,
Sam
Luis, mil perdones si no se entiende, tratare de explicarlo en español, básicamente es eso que dices, pero lo que no puedo lograr es pasar la variable [Data] conteniendo el json. Pongo un ejemplo con ese mismo código que pusiste para ver si puedo lograr explicarme un poco mejor.
Trataría de sacar el contenido de la variable [Data] del Container1 de este modo por ejemplo:
GetObjectHTML "Container1" [stat_usr]
después:
.Create data
CreateEmptyArray [Data]
BeginJS
$App.Data = [stat_usr]
EndJS
.Render data
neoTableSetColumn "Container1" 1 "USERNAME" "User name" "" true false true ""
neoTableSetColumn "Container1" 2 "ACCOUNT_STATUS" "Account Status" "" true false true ""
neoTableInitTable "Container1" "es-ES" 0 "Table" true true true true false ""
neoTableLoadData "Container1" [Data]
Pero no me funciona. Lo otro que me esta pasando y no se si tiene que ver es que el contenido de la variable [Data] la consulta a la bbdd usando la función var_dump(json_encode($res)); ahora me lo esta retornando desde el PHP en este modo:
string(56) "{"USERNAME":"DIP","ACCOUNT_STATUS":"EXPIRED & LOCKED"}"
no sé si alguien ha tenido experiencia similar que me ayude a pasar lo anterior a:
[{"USERNAME":"DIP","ACCOUNT_STATUS":"EXPIRED & LOCKED"}]
Se que son dos temas pero por ahí uno depende del otro.
Regards,
Sam

Quote from luishp on June 23, 2021, 10:55 am@lesanch yo creo que el problema lo tienes en como recuperas la información desde la base de datos. No entiendo que vaya a un contenedor y desde ahí lo recuperes como HTML a un Array (eso no se puede hacer tal cual lo estás intentando y por eso no te funciona) Lo normal es recuperar los datos directamente en una variable sin paso intermedio. La forma más fácil de hacerlo es utlilizando el plugin neoAjax. Fíjate en los ejemplos que vienen incluidos.
Una vez que hayas conseguido recuperar los datos correctamente no vas a tener mayor problema.
Saludos!
@lesanch yo creo que el problema lo tienes en como recuperas la información desde la base de datos. No entiendo que vaya a un contenedor y desde ahí lo recuperes como HTML a un Array (eso no se puede hacer tal cual lo estás intentando y por eso no te funciona) Lo normal es recuperar los datos directamente en una variable sin paso intermedio. La forma más fácil de hacerlo es utlilizando el plugin neoAjax. Fíjate en los ejemplos que vienen incluidos.
Una vez que hayas conseguido recuperar los datos correctamente no vas a tener mayor problema.
Saludos!