NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: urayoan on August 27, 2020, 04:47:36 AM
-
Hi all. It is possible to create a Browse View without a table ans select a record from that table?
If yes, some ideas would be helpful.
Thanks @UrayoƔn
-
Hi,
I use the IMDD if I need to work on some data that doesn't have a table in the database schema.
I've also hand coded my own browse in html, but if you want some or all of NTs (generous) Browse functionality, i'd suggest IMDD, its handy. I even some some generic IMDD structures for general purpose stuff.
Regards
Bill
-
>> Is it possible to create a Browse View without a table ans select a record from that table?
no
Use a table. InMemory table would be fine.
Of course DROP controls allow you to select from non-table-items. But you can't browse a non-table.
-
Thank you Bill and Bruce,
The problem i have is, i have the dictionary, but i am not authorized to make changes on it.
Another way i was thinking is, make the table declaration in the Global Embeds, but i don't know if the NetTalk template does like that.
What do you think about that Bruce?
-
Ok, you made this weird by not being able to change the dictionary.
Try https://datatables.net/ Its actually pretty easy and you supply the table contents via json.
I've included a pic of me using it (table at bottom of the page)
-
>> The problem i have is, i have the dictionary, but i am not authorized to make changes on it.
A hand-coded table won't work, because the templates work on the dictionary.
Your alternative then is either hand-coding a table of some kind, or waiting for NetTalk 12 (which has "Json List support")
Cheers
Bruce
-
Your alternative then is either hand-coding a table of some kind, or waiting for NetTalk 12 (which has "Json List support")
:)
-
Ok, you made this weird by not being able to change the dictionary.
Thank you Bill, i was taking a similar approach, but creating the js on my side. Definitely the tool you show me here it gonna help me a lot with this!
-
>> The problem i have is, i have the dictionary, but i am not authorized to make changes on it.
A hand-coded table won't work, because the templates work on the dictionary.
Your alternative then is either hand-coding a table of some kind, or waiting for NetTalk 12 (which has "Json List support")
Cheers
Bruce
Thanks Bruce, cant wait to see that tease you give us with NetTalk, sadly, cant wait for that because the project is rush, but very exited to see that is gonna be possible to do in near NetTalk releases!
-
Hope they help. They suit me when i'm doing light weight pretty stuff. You do get pagination, sorting on columns and some other stuff.
-
Why dont use an existing dct file changing its porp:name?
You can choose a file similar to what you need, change its prop:name and fill that named file with the records you need.
Just a thought.
-
This might fast track you (or not!) but maybe it will help.
<section id="configuration">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h4 class="card-title">Listing & Sales Performance</h4>
</div>
<div class="card-content">
<div class="table-responsive">
<table class="table table-striped staff-table">
<thead>
<tr>
<th>Name</th>
<th class="dt-right">Listings</th>
<th class="dt-right">Sales</th>
<th class="dt-right">%</th>
<th class="dt-right">Days on Market</th>
<th class="dt-right">Withdrawn</th>
<th class="dt-right">%</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
Thats my HTML
<script src="/app-assets/vendors/js/tables/datatable/datatables.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.staff-table').DataTable( {
"order": [[ 1, "desc" ]],
"info": false,
"bLengthChange": false,
"bFilter": false,
"iDisplayLength": 6,
"columnDefs": [{
targets: -1,
className: 'dt-right'
}],
"columns": [null,{"width": "100px"},{"width": "100px"},{"width": "80px"},{"width": "100px"},{"width": "100px"},{"width": "80px"}],
"ajax": '/GenTable?c=listing'
});
});
Thats the Scripts on the bottom of the same page.
/GenTable?c=listing
That my NetTalk function that generates the JSON.
st.SetValue('')
Access:MyFile.Open()
MyFile{PROP:SQL} = 'MyQuery'
LOOP
NEXT(MyFile)
IF ERRORCODE() ~= 0 THEN BREAK.
st.Append('["'&CLIP(Field1)&'","'&CLIP(Field2)&'","'&CLIP(Field3)&'","'&LEFT(FORMAT(Field4,@n$20))&'","'&LEFT(FORMAT(Field5,@n3))&'%"]',1,',')
.
st.Prepend('{{ "data":[')
st.Append(']}')
Thats a snippet of my NetWebPage that creates the JSON.
-
Why dont use an existing dct file changing its porp:name?
You can choose a file similar to what you need, change its prop:name and fill that named file with the records you need.
Just a thought.
Didn't think of that Alberto, but will try and see if it is doable in my case! Thanks for the hint
-
This might fast track you (or not!) but maybe it will help.
Oh yes Bill, that does help a lot. Thanks!
-
I've included a pic of me using it (table at bottom of the page)
BTW i forgot to mention, very well done job you have made with your page!