Cbi/tblsection under tab

Greetings to all !
In the same domain..
I tried to move this table (.template = "cbi/tblsection" MQTT topics & Modbus address) under the "test" tab.
Currently, this table is under the whole 3 tabs, not just under 1 tab.
It's a TypedSection with .template="cbi/tblsection". I didn't get to put taboption as tblsection.
But that must be possible, like the "Static Leases" in "DHCP and DNS" Luci page.
So if you have any idea. Thanks.
The code I try to use for that (here as a comment):

-- tt = m:section(TypedSection, "test", translate("test title"))
-- s:tab("general", "General Tab Title", "General Tab Description")
-- s:tab("advanced", "Advanced Tab Title", "Advanced Tab Description")
-- s.template = "cbi/tblsection"
-- opt = s:taboption("general", Value, "usb_port", "Title Text")
-- opt = s:taboption("general", Value, "toto", "Title Text")
-- opt = s:taboption("advanced", Value, "usb_port", "Title Text")
-- opt = s:taboption("advanced", Value, "usb_port", "Title Text")
	-- test
	-- tt = m:section(TypedSection, "test", translate("MQTT topics & Modbus address"), translate("Please add here your MQTT Topics."))
--tt.template = "cbi/tblsection"
--	s.template = "cbi/tblsection"
--	s:taboption("test", Value, "testtest", "I want my MQTT table below")
--	s:taboption("test", Value, "testtesttesttest", "testtesttesttesttesttest")
--	yy.template = "cbi/tblsection"
![]

(https://forum.openwrt.org/uploads/default/original/3X/2/5/2503d5027a968bb316f54116e6983cbb7d58fc00.jpeg)

1 Like

Static leases show up for me wherever any of the 4 Server Settings tabs is selected, it is not shown just under one of the tabs.

@jow -- is it possible to have TypedSection (or some derivative) belong to a specific tab?

Yes this is possible but only using new style JavaScript based CBI forms which provide an option type (CBISectionValue) that allows to wrap an entire section into an option container.

With Lua based CBI forms this is not doable unfortunately.

1 Like

@jow do you know if anyone is working on the documentation for the JS-based CBI?

@stangri I started adding JavaScript documentation here http://openwrt.github.io/luci/jsapi/index.html but it is work-in-progress. I still need to add docs for form.js (the JS CBI) and ui.js (low level widget class) as well as more high level documentation.

1 Like

Thanks a lot @jow & @stangri !
I can stop looking, so...
Have a good continuation!

Hi @stangri
I'm going back to the fact that you said " Static leases show up for me wherever any of the 4 Server Settings tabs is selected, it is not shown just under one of the tabs "
But if I change of tab (General Settings and others), I don't see anymore the " Hostname / MAC-Address /
IPv4-Address / Lease time / ..." table.
It is that I want.
Like also Routes, IPv4 and IPv6 tabs have each their cbi/tblsection.
Maybe there are an missunderstanding or their use something else.
I agree to have a selection by tab, with each its "Save & Apply" button.
Now, my tblselection is present whatever the tab is selected. Present at the bottom of every page.
Thanks for your help

Sorry, I was checking on 18.06 which doesn't have the new JS-based templates.

Ok, so, it uses this famous JS-based templates..I'm gonna see if there's anything I can do.. Thanks @stangri