Datatables and Semantic wide previous and show controls
Datatables and Semantic wide previous and show controls
I went to https://datatables.net/download/index and download the libs using the following options:
Styling Framework: Semantic UI
Select Packages: DataTables
Extensions: AutoFill, Buttons, ColReorder, FixedColumns, FixedHeaders, KeyTable, Responsive, RowGroup, Scroller, Select.
Added the following recomended style and script
<link rel="stylesheet" type="text/css" href="DataTables/datatables.min.css"/>
The table shows up but the "Previous" button and "Show" drop down are too wide:
Here is how I initialize the code:
var gridAccounts = $('#gridAccounts').DataTable({
select: true,
ordering: true,
paging: true,
searching: false,
bFilter: false,
responsive: true,
bInfo: false,
data: [],
rowId: 'id',
columns: [
{ data: 'id', title: 'ID' },
{ data: 'first_name', title: 'First Name' },
{ data: 'last_name', title: 'Last Name' },
//{ data: 'email', title: 'Email' },
{ data: 'type', title: 'Security Type' },
{ data: 'account', title: 'Account'},
{ data: 'status', title: 'Status'}
],
columnDefs:[
{ targets: [0], visible: false }
]
});
This question has an accepted answers - jump to answer
Answers
It appears to work okay here.
Could you give me a link to your page so I can check it out please?
Thanks,
Allan
Ive seen that and tried followed the sample there. Unfortunately its only in development right now and is not available outside of my laptop right now.
Thanks for offering to help
Is there a css to control those fields style? That way I can investigate on my end
Not as far as I am aware. What version of Semantic UI are you using?
Allan
Its version
"version": "2.2.13"
which is part of my Vue project
I've just tried building a simple example: http://live.datatables.net/cudetita/1/edit .
That also appears to work no problem.
I'd need a link to a test case showing the issue to be able to offer any help. My guess is that there is some other stylesheet which is adding styles causing the issue, but without a test case it is impossible to say.
Allan
Thank you. That is what I was thinking also. I will do some checking on the styles I have to see
I'm using chrome to analyze the css and wondering why the show control has class "eight wide" columns? Seems a bit wide. If I change it to something smaller like four it looks a lot better.
I think your problem is here:
[..]
Added the following recomended style and script
<link rel="stylesheet" type="text/css" href="DataTables/datatables.min.css"/>
[..]
Because the styles are also generated by the builder and if you change something in the order of the style sheets you will get unpredictable results.
So if you use the builder you have to copy not only the js part, but also the css part.
In your case you needed to use:
But if I am wrong, sorry for that, but I based my response on the information you were giving.
Sorry I didnt put that information. Yes I do have the js files.
Its just to split the area above the table in half - half to the left, half to the right. It isn't required, but it shouldn't make any difference.
Allan
In chrome if I change that class to "four" it makes the width smaller
It will make the container smaller certainly - which might result in the other styles being effected. However, given that the two demos I've put together don't appear to demonstrate this issue and I've not otherwise been able to see the problem to debug it, I'm not yet sure what is causing it, nor how to resolve it properly.
Allan
Thanks Allan. I will look at my end to see what is causing that
I just want to give an update. If I use DataTables styling framework and not the Semantic-UI styling framework everything looks correct. So for the meantime I will just the DataTables framework
Fair enough - thanks for posting back. If you ever go back to it let me know if you are able to get a test case up showing the issue.
Allan