Questions about neotable - Forum

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

Questions about neotable

Hi @Luishp I would like to reproduce the design of the screen1. I am able to make the screen2.

The principal difference is that the container is inside an expandable/collapsable row master, and the height of the detail table is ajustable in screen1.

Is it possible to do that with neotable ?

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

@phil78 that's an interesing question. To tell you the truth, I don't know.
Perhaps it's possible with some additional custom JavaScript, but I'm not sure.

Ok thank you @Luishp.

Just one more question when I put the bootstrap class table-striped ot table-condensed on the property of the container, i do not see any difference ?

@phil78 that class is for tables not for Containers.
Try adding CSS directly in App Properties > Styles using your own Container name and colors, etc.

#Container1 td{
  color:#2e506a;
  border:1px solid #215a85!important;
}
#Container1 table{
  border-radius:10px;
}
#Container1 th, #ContainerAccesos th-inner{
  background:#173f5d;
  color:#fff;
}
#Container1 tr:nth-child(even) {
    background-color: #f2f2f2; /* Gris claro */
  }
#Container1  tr:nth-child(odd) {
    background-color: #ffffff; /* Blanco */
}

Regards.

Phil78 has reacted to this post.
Phil78

Hi @Luishp

when I try to adjust the container height to the number of table rows I get this error :

Uncaught TypeError: $App.NAB[objId].css is not a function
SizeObject http://localhost/TableMaitreDetail-Web/js/main.js:2
GetDetail http://localhost/TableMaitreDetail-Web/js/main.js:48

 

neoTableSetColumn "Container2" 1 "Nom" "Nom" "250px" false true false ""
neoTableSetColumn "Container2" 2 "Heure" "Heure" "100px" false true false ""
neoTableSetColumn "Container2" 3 "Date" "Date" "100px" false false false ""
neoTableInitTable "Container2" "fr-FR" 0 "Table" false false false false false "DetailBack"
neoTableLoadData "Container2" [Detail]
neoTableHideColumn "Container2" "Date"
Math "25+[nbLigne]*15" 0 [haut]
SizeObject "Container2" "350" [haut]
Math "[haut]+35" 0 [haut]
SizeObject "Container3" "730" "[haut]"
MoveObject "Container3" 30 ([NAB.MouseY]+15)
ShowObject "Container3" "none" 0

 

@phil78 it seems you are trying to resize a non existent Container3?
Anyway please left the Container "height" empty in the properties panel and it will take automatically the height of the content inside.

Regards.

No as You can see in my first message and in the lines of code, container2 is the neotable and container3 contain container2. I try to resize first cantainer2 which causes the error before container3.

When I request on the console for $App.NAB[objId]  ==> objId is not defined.   how is it possible, I do not have any error if I do no not resize ?

@phil78 Have you checked main.js lines 2 and 48? (just follow the error link)

yes

line 48 $scope.SizeObject("Container2",350,0);

line 2 $scope.SizeObject=function(objId,width,height){if($App.NAB[objId]){w=fixUnit(width);h=fixUnit(height);$App.NAB[objId].css("width",w);$App.NAB[objId].css("height",h);}else{$scope.SetObjectBounds(objId,null,null,width,height);}

If I had a wait before SizeObject, I can see the detail table but I have 2 time the same crash.

It seems that SizeObject it not compatible with a container neotable, because if I try to resize container1 which is the master table, there is also a crash, while resizing container3 never crash.

@phil78

1. Using neoTable Inside Expandable/Collapsible Containers

You’re attempting to replicate a screen where a neoTable is inside an expandable/collapsible row master container, and the height adjusts dynamically to the number of detail rows.

NeoTable with Expandable/Collapsible Containers

Yes, this is technically feasible, but VisualNEO Web does not provide built-in support for dynamically resizing containers based on neoTable content due to how rendering and object sizing are handled.

You can implement an expandable/collapsible effect using:

  • Master/Detail table design: With toggled visibility of a container.

  • JavaScript + CSS: Using overflow, dynamic height properties, and DOM manipulation, although this requires careful handling of rendering timing.

2. Dynamic Resizing and $App.NAB[objId].css is not a function Error

The error:

Uncaught TypeError: $App.NAB[objId].css is not a function

...suggests that Container2 is not yet fully initialized when SizeObject is called. NeoTable likely modifies DOM asynchronously, hence any immediate action like resizing might run too early.

Fix Suggestions

  • Defer Execution: Use Timer or Wait to delay resizing until the DOM is fully rendered.

    Wait 500
    SizeObject "Container2" 350 [calculatedHeight]
    EndWait
  • Avoid SizeObject for NeoTables:
    If resizing is critical, try resizing the parent container instead (Container3), and let the inner content adapt using CSS (height: auto, overflow).

3. Why table-striped or table-condensed Classes Don't Work

These Bootstrap classes apply to <table> elements. If you add them to a Container, they won’t have any visual effect.

Correct Usage

Apply styles to the table within the container, like so:

#Container2 table {
      border-collapse: collapse;
}
#Container2 tr:nth-child(even) {
     background-color: #f2f2f2;
}

Hi luis, Thanks for your answers. In fact, any attempt to change the size of a table container will fail.
The best thing to do is to avoid the border of container2 and change the height of container3 only.

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