Problemas con Neotable - Forum

Forum Navigation
You need to log in to create posts and topics.

Problemas con Neotable

Hola Luís, he estado haciendo muchas pruebas y he visto ejemplos pero no acabo de ver como funciona el Neotable (debe ser sencillo pero no acabo de verlo).

Creé un contenedor para poner el contenido de la tabla, pero no me salen los registros lo que no tengo claro, si tengo que ir haciendo iteraciones o directamente salen los datos en la tabla .Usé la dirección para que me devolviera una JSON y la pusiera en una variable https://jsonplaceholder.typicode.com/comments?postId=1 esta me devuelve un listado compuesto por estos datos y por cada registro, todo eso sale bien pero cuando entro a poner todos estos datos en el neotable no sale ningún dato.

Aquí te dejo el código que estoy escribiendo para enviar los datos a la tabla

CreateEmptyObject [album]
LoadJSON "https://jsonplaceholder.typicode.com/comments?postId=1" [album]

neoTableResetColumns "Container1"
neoTableSetColumn "Container1" 1 "postId" "Id" "" true false true ""
neoTableSetColumn "Container1" 2 "name" "Nombre" "" true false true ""
neoTableSetColumn "Container1" 3 "email" "Email" "" true false true ""
neoTableSetColumn "Container1" 4 "body" "Contenido" "" true false true ""
neoTableInitTable "Container1" "es-ES" 0 "Table" false false false false false ""
neoTableLoadData "Container1" [album]

Cuando uso neoTableSetColumn "Container1" 1 "postId" "Id" "" true false true "" no se si tengo que poner directamente el nombre del campo o [album.postId] o si tengo que tratar los datos de otra forma.

Solo quiero que salgan los datos en la tabla y pueda verlos .¿ Si los datos que hay en el json fueran más complejos como se puede acceder a cada registro?

Muchas gracias por todo !!

I copied your lines of script into a Page of the tutorial so all the existing lines were replaced, and then renamed the container of the tutorial to be Container1 to match your code.

When tested in the browser, the JSON data loaded into the table without any problems. Please see the images.

A couple of ideas:

  • If you look in the Console of the Developer Tools are there any error messages?
  • Do you have a basic single page app where you are testing the table? If you do, and could attach it here, I am happy to test it and see if I can spot the problem.

edit: if I have misunderstood the question or problem because of language differences, then I apologise in advance.

Uploaded files:
  • You need to login to have access to uploads.
luishp has reacted to this post.
luishp

Hola @susan, gracias por contestar, la verdad he tenido que desinstalar y volver a instalar todo para que funcionara.

NO sé porque no funcionaba. Como bien dices estaba bien el código pero aquí daba errores.

Ahora me faltaría saber ¿ Si los datos que hay en el json fueran más complejos como se puede acceder a cada registro? veo que deben tener una correlación y que tiene que estar en una zona [0] [1]....[n]

Ya que si pertenecen a datos concretos no los pone en ninguna tabla.

También me gustaría saber como seleccionarlos y editarlos ya que si vienen de una base de datos externa y hay que cambiar alguno de ellos creo que seria bastante importante.

Nuevamente Susan te doy las gracias por revisar el código ya que aquí no funcionaba

Muchas Gracias!!

susan has reacted to this post.
susan

Everything I mention in this reply is not based on experience because I have not made an app that uses neoTable, so these are only my suggestions after reading the resources.

I don't think neoTable can handle more complex JSON, I imagine the array of objects must fit a pattern of rows and columns, and anything outside of that might not load?

It looks like the neoTableEditColumnAsText action is the key to editing and storing changes to the data. In the Online Tutorials

there are a few there that use neoTable and the neoTableEditColumnAsText action with a database, and there are also copies in the \Documents\VisualNeoWeb\Sample Apps\neoPhpSamples folder to examine.

luishp has reacted to this post.
luishp

Hola de nuevo, sigo parado con el tema de Neotable, hice varios ejemplos y funciona veo los datos, pero al pinchar en una de las filas directamente en la consola me da error. Me muestra las variables que vi que están relacionadas con Neotable ( [neoTableRow] [neoTableEvent] [neoTableField] [neoTablePage [neoTableSearch]), y hace las búsquedas pertinentes y las muestra.

Pero como digo al clicar en una de las filas, miro en la consola y me sale el error (Uncaught TypeError: eventFunc is not a function) el código es el mismo que hice como ejemplo y me indicasteis estaba bien estructurado (he hecho mil pruebas y en todas me sale el error al elegir la fila o cualquier dato).

Os dejo unas capturas.

Gracias por adelantado!!

Uploaded files:
  • You need to login to have access to uploads.

@sivol parece que en algún punto has definido un evento (¿hacer clic sobre una fila?) pero la subrutina que debe ejecutarse al hacer clic no existe. De ahí el error.
Eso es lo que creo, pero es muy difícil ofrecerte más ayuda con la información de que disponemos.

Saludos!

Hola @luishp el ejemplo es el de arriba

CreateEmptyObject [album]
LoadJSON "https://jsonplaceholder.typicode.com/comments?postId=1" [album]

neoTableResetColumns "Container1"
neoTableSetColumn "Container1" 1 "postId" "Id" "" true false true ""
neoTableSetColumn "Container1" 2 "name" "Nombre" "" true false true ""
neoTableSetColumn "Container1" 3 "email" "Email" "" true false true ""
neoTableSetColumn "Container1" 4 "body" "Contenido" "" true false true ""
neoTableInitTable "Container1" "es-ES" 0 "Table" false false false false false ""
neoTableLoadData "Container1" [album]

No veo ninguna llamada a ningún evento. ¿Puede que haya que poner alguno para que no de esos errores?

Gracias Luís, seguiré mirando a ver donde está el error, ya que parecía que funcionaba pero en la consola da errores.!!

 

@sivol

Your posted code is the same as the page labelled Basic Table in the Tutorial for neoTable (Sample Apps >>> Tutorials >>> neoTableTutorialPart1).

I can rereproduce the error you mentioned ... but it only shows up WHEN I try and click on a row.

It looks like when a user clicks on a row (even though you have set it up as non-selectable), the plugin/library code tries to invoke an event function (which ofcourse does not exist).

The immediate workaround would be to set up an event function that does nothing.

Longer term, I will leave it to @luishp to consider ...

- such row clicks as not a selectable event

- or trapping this condition, and not looking to invoke a non-existent event
function

luishp has reacted to this post.
luishp
Open chat
1
Do you need more info?
Hi, do you have any doubt?