How to align a label inside a div using DataTables - datatable

I want that a Button, a Select and a Label to be in the same div or at least on the same line
and this is mi dom:
$('#tablaEntrega').DataTable({
dom: "Blfrtip",
)};
I tried moving the letters of the dom but does not appear to fix it

Related

Is there any way to start subgrid with particular column of main grid or can we shift subgrid icon column postion?

Please see my below jqgrid subgrid image,
Question 1 : By default, my sub grid start with parent grid column "ID" (first column of parent grid), Can we start my sub grid from 3rd column of my parent grid (Contact Name)?
Question 2 : Or, Is there any chance to move sub grid icon (+) column after 2nd column of my parent grid, hence my sub grid will start with 3rd column of my parent grid?
Please suggest, Thanks!
The row with the standard subgrid like on the picture below
consist from three parts which I marked in different colors. The corresponding HTML structure looks like on the next picture
jqGrid creates an empty <div> (see <div class="tablediv" id="list_1"></div> marked in red) and calls subGridRowExpanded callback with the id of the div ("list_1" on the picture above) as the value of the first parameter. One places an empty <table> with some unique id attribute in the div with and creates grid from the <table>. The typical code looks like
subGridRowExpanded: function (subgridId, rowid) {
var $table = $("<table id='" + subgridId + "_t'></table>");
$("#" + subgridId).append($table);
$table.jqGrid({
// ...
});
}
What you can to do is to set some CSS attributes on the <div> to place the table on the place where you need it. For example I have the column "sequence" in the parent grid of the demo used on the pictures. The header of the column of the header have gridId + "_sequence" id. So one can use the following code to set padding-left to skip the first column:
subGridRowExpanded: function (subgridId, rowid) {
var $table = $("<table id='" + subgridId + "_t'></table>");
$("#" + subgridId).append($table)
// set padding-left to the outer width of the first column "sequence"
// of the parent grid
.css("padding-left", $("#" + this.id + "_sequence").outerWidth() + "px");
$table.jqGrid({
// ...
autowidth: true
});
}
The advantage of the usage padding-left: one can use autowidth: true in the subgrid to resize the subgrid to fill the right part of the row of subgrid.
The demo uses the code. The results looks like on the picture below
You can change other attributes of subgrid row inside of subGridRowExpanded to achieve your exact goals.

Is it possible to set the alignment of kendo datepicker's dropdown calendar in kendo grid with respect to the textbox

When the datatype is Date, the kendo grid uses a kendo datepicker with dropdown calendar for the column.
The datepicker's dropdown calendar usually aligns itself flush with the left edge of the input box. If there isn't room for that, it is moved to the left, but not quite enough. This presents a problem when the rightmost column in the grid is a Date, and the grid is occupying 100% of the width available on the screen: the Saturday column in the dropdown calendar gets "cut off". See pic attached.
Is it possible to tell the calendar dropdown (for a particular column) to align itself flush with the right edge of the text input?
I know that bug. Your datepicker animation container is hidden under right scrollbar. If you set body overflow to hidden, you will not have a scrollbars and calendar will fit and touch right border of screen, like in this example: http://dojo.telerik.com/UCOhA
However if you can't turn off the body scrollbars you need to set calendar position manually dirty way like this:
$("#piker").kendoDatePicker({
open: function(e) {
//setTimeout to let kendo make k-animation-container element at first open
setTimeout(function(){
var animationContainer = $("#" + e.sender.element.attr("id") + "_dateview").parent();
var left = e.sender.element.offset().left + e.sender.element.closest('.k-datepicker').width() - animationContainer.width();
animationContainer.css('left', left);
});
},
//turnoff the animation to avoid strange visual effects
animation: {
open: {
duration: 0
}
}
});
Running example: http://dojo.telerik.com/Imiqa/2

Insert HTML before an element in CKEditor

What is the best way to programmatically insert HTML (that represents a CKEditor widget) before an existing element in CKEditor?
The content editable is not in focus and is not currently being edited.
For example, suppose the contents of the editor are:
<h1>Here's a title</h1>
<h2>Here's a subtitle</h2>
<p>Here's a paragraph</p>
<p>Here's a paragraph</p>
<p>Here's a paragraph</p>
Now, say I have a reference to the second <p> element. What is the best way to insert html before this tag? (Keeping in mind that the HTML that I want to insert will become a Ckeditor widget after inserting.)
Thank you very much for any help,
Michael
With the current API it is not possible to insert HTML string at the specific position without involving selection (EDIT: since CKEditor 4.5.0 it is possible – read below), because the editor.insertHtml method inserts in the selection position. However, if you have a simple situation that your HTML string contains just one element (with some ancestors), then you can easily use editor.insertElement on a lower level, when you can specify range at which you want to insert element:
var range = editor.createRange(),
element = CKEDITOR.dom.element.createFromHtml( elementHtml );
// Place range before the <p> element.
range.setStartAt( elementP, CKEDITOR.POSITION_BEFORE_START );
// Make sure it's collapsed.
range.collapse( true );
// Insert element at the range position.
editor.editable().insertElement( element, range );
As you can see this code uses editable.insertElement, which is used by editor.insertElement.
PS. Remember that insertElement will not upcast and initialize your widget. You can find more about this here - CKEditor, initialize widget added with insertElement.
Since 4.5.0
CKEditor 4.5.0 introduced editor.editable().insertHtmlIntoRange() as well as a range parameter for editor.insertHtml(). The latter method is a more high-level one, so it will take care of undo manager and setting selection in place of insertion. The former one is more a low-level method and it only inserts the data.
If you want to insert an element between or outside of the paragraphs
, the CKEDITOR.POSITION_BEFORE_START flag won't work because the element will still be placed inside the <p></p> node.
However, the CKEDITOR.dom.node.insertBeforeMe() method will place the new element before any editor node without wrapping it or confining it to a text node.
var startRange = editor.getSelection(); //Cursor position
var parent = startRange.getStartElement(); //The parent <p> or <span> of the cursor
var e1 = CKEDITOR.dom.element.createFromHtml("<h3>Subtitle before paragraphs</h3>");
parent.insertBeforeMe(e1); //Places new node before the specified node
Hope this helps!
its smoothly simple as this
$(document).ready(function(){
$("#add1").click(function(){
CKEDITOR.instances.editor2.insertHtml( '<ul><li>Computers & Electronics</li></ul>' );
});
});

Need to extend grid column and row borders to bottom of Kendo grid

I am adding columns to kendo ui grid dynamically.
When there are many rows in the grid the rows are having borders and displaying it correctly.
But, when there are very few rows in the grid the last row or doesn't seem to show border.
Can the cell borders on a Kendo grid extend to the bottom of the grid area when there are not enough rows in the grid
#(Html.Kendo().Grid<Model>()
.Name("GirdName")
.Scrollable(scr => scr.Height(100))
...
$(document).ready(function () {
$("#GirdName>.k-grid-content>table").css("height", 100);
})

Why are my columns getting set very wide when I call setColumns on SlickGrid

When I create a SlickGrid this way:
var grid = new Slick.Grid(
element, //needs to be something jQuery can act on: element, css selector, etc.
dataView,
[], //columns
gridOptions
);
And then set the columns like so:
grid.setColumns(parameters.columns);
grid.autosizeColumns();
Do my columns come out very wide?
If I remove or comment out the line:
grid.autosizeColumns();
The columns are rendered as I would expect.

Resources