Trying to make 3 columns of data with equal spacing in Enyo - webos

I have a project I'm working on for enyo, that needs to have 3 column with the following format:
--- date--- ---- message ------- ----- attachments-------
The problem is that each line has a different spacing. So if the first date is 1/2/10012 and the next date is 12/22/2002, the message column will not line up. I've looked into using a slidingPane, but was wondering if there was a more simple way to do it.

I'm not sure if I understand the question fully, but if you want a block of display to contain 3 equally spaced "columns" you can do something like:
{kind: enyo.VFlexBox, components: [
{kind: enyo.HFlexBox, flex: 1, align: "center", pack: "center", components: [
{name: "column1", flex: 1, content: "Column 1"},
{name: "column2", flex: 1, content: "Column 2"},
{name: "column3", flex: 1, content: "Column 3"},
]}
]}

I believe that what you want is the VirtualRepeater. This allows for a repeating list of rows (It say maximum of ~100 rows, so make sure that'll work for your use case). This should allow for variable height rows (Which is what I Think you're talking about). In your getItem function you can fill in each row as needed and they'll line up.

Related

Is there a way to create a runtime field in Elasticsearch that is equal to a 'Value'/'Sum of Value across index'?

I have a task to show the percent of value a set of filtered documents represents vs the entire value represented across a whole year. For example:
[{
name: 'Foo',
value: 12,
year: 2021
},
{
name: 'Bar',
value: 2,
year: 2021
},
{
name: 'Car',
value: 10,
year: 2021
},
{
name: 'Lar',
value: 4,
year: 2022
}]
I'd like to create a runtime field that would equal .5 for 'Foo' (12/(12+2+10)), .42 for 'Car' (10/(12+2+10)) and 1 for 'Lar' (4/4). Is this possible? Is there a better way to achieve this result? The ultimate goal is that if someone creates a query that returns 'Foo' and 'Car' they could sum the runtime field to get .92 (.5+.42) and that such a result could be used in a Kibana Lens visualization.
I've tried creating queries that return the above results, and that is easy enough, but those queries aren't usable inside Kibana which also has global filters to account for. That's why I thought a calculated field that represents the ratio of a document's value in relation to the sum of all documents' values would be useful.

How to do a custom sorting in datatables?

Is it possible to sort numeric item according to its values in a column which contains both numeric and string items in datatables?
I tried columnDefs:
[{ type: 'natural', targets: [0,1] }]
But it's not working. Any help is appreciated.
Well, perhaps you just need to see a working example? Here is the values from the other question you are referring to, and the usage of a sorting plugin I once made for exactly this, any-number -> https://github.com/davidkonrad/Plugins/blob/master/sorting/any-number.js
var table = $('#example').DataTable({
columnDefs : [
{ type: 'any-number', targets: [0] }
]
})
see how it is working here -> http://jsfiddle.net/o53burrf/
This is how most of the other sorting plugins works as well - if you want to use natural, include the source snippet an replace any-number with natural.

How to change Kendo Grid Filter Format

I have a field in my grid that are IDs that range from 1 to 2000. I have it designated as a number in the field definition.
The issue is when I use the filter and type in say "1000" when I return to the filter to put in another number it displays "1,000.00". I don't want the filtered text box to show the comma or decimal point. That format isn't relevant for this field.
How do I correct this?
Thanks in advance!
While #Flores answer pointed me in the right direction, it did not do what was expected. At least I still had commas in my filter using his snippet. I ended up making a small modification to the code to achieve the desired result.
filterable: {
ui: function (element) {
element.kendoNumericTextBox({
format: '#',
decimals: 0,
});
},
},
That will give you only numbers. No commas and no decimals.
You can set format on the filterable on the column like this:
field: "TaskId",
title: "TaskId",
width: 80,
filterable: {
ui: function (element) {
element.kendoNumericTextBox({
format: "n0"
});
}
}
You should consider using custom filter menu. Here is how to create DDL. In your case you will need to create numeric textbox with specific format.
Per Kendo support:
If filterable.mode is set to 'row', columns.filterable.cell.template should be used to customize the input. Please refer to this example http://dojo.telerik.com/UKulA/2.
You can limit the range using min and max like in the sample above.

Jqgrid sorting numeric order

As far as I know sorting in jqgrid will be like this sortname: 'Key', sortorder: "asc", but everytime the 'Key' shows it's not in numeric order. It looks like:
Key
1
10
100
1000
1001
1002
My output needed:
Key
1
2
3
4
5
Any help? Thanks
a extract of your code might be usefull...
Try to specify the sorttype option to int in your colmodel http://www.trirand.com/jqgridwiki/doku.php?id=wiki:colmodel_options
you have to assign the sorttype:'int' inside the specific colModel that you want sorted
for ex. { name: 'Key', index: 'Key', width: 100, align: 'left', hidden: false, sorttype:'int' }

jqGrid: Search with smaller set of searchoptions does not work

jQGrid version : 3.7.2
jquery version: 1.4.2
Issue: creating search dialog with a subset of operators:
var searchOptions = {
caption: 'Filter...',
multipleSearch:true,
closeAfterSearch:true,
closeAfterReset:true
};
$('#list').jqGrid({
colModel: [
{
name:'abc', sorttype:'int', sortable: true, search:true,
searchoptions:{sopt:['eq','ne']}
}
],
pager: '#pager'
}).navGrid('#pager', {search: true, edit:false, add:false, del:false},
null, null, null, searchOptions);
When the search popup comes up, pick 'Not Equal' and input a number and click on 'Search' button. The grid rows do not reflect the search criteria! However, if you remove 'searchoptions' from colModel, it works fine.
Has anyone else encountered this issue?
Thanks
I can not reproduce your problem. Probably you have a bug in your example.
You can verify on the demo example that "equal" and "not equal" operations work. In the example 12 rows will be added in the grid. If you will search for 'Inv No' equal to 4, one row will be displyed. If you will search for 'Inv No' not equal to 4, first page from 11 rows will be displyed (see on the right size of the pager). If you will search for 'Inv No' not equal to 44, first page from 12 rows will be displyed. So all work without any problem.
I verified the results with jQuery 1.4.2 and jqGrid 3.7.2, but I am not a friend of retro versions and I used in the final version of the demo jQuery 1.4.4 and jqGrid 3.8.2.

Resources