Can we exclude row from filtering - YADCF Plugin - yadcf

Is there any possibility for excluding the row from filter.
Suppose i have 20 <tr> i want 1, 6, 11 or any number row will not be effected by the filtering. It will be always visible.
Thanks in advance....

You can try the html5-data-attributes along with yadcf html5_data , you can try omit the data-filter from certain rows
html5_data -
Required: false
Type: String
Default value: undefined
Possible values: data-filter / data-search / anything that is supported by datatables
Description: Allows to filter based on data-filter / data-search attributes of the element, read more: http://www.datatables.net/examples/advanced_init/html5-data-attributes.html

Related

ADO.NET - Accessing Each DataView in DataViewManager

Looks like a silly question, but I can't find a way to access the DataViews in my DataViewManager.
I can see it in the DataViewManager Visualizer window, so there must be a way.
What am I doing wrong?
dvm = New DataViewManager(MyDS) ''-- MyDS is a strongly typed dataset
dvm.CreateDataView(MyDS.Company)
dvm.CreateDataView(MyDS.Sites)
MsgBox(dvm.DataViewSettings.Count) ''-- shows 7, even though I added only 2.
For Each view As DataView In dvm ''-- Error!
MsgBox(view.Table.TableName)
Next
I also observed that irrespective of how many DataViews I create, data the DataViewManager Visualizer shows all DataViews in my dataset. Why?
how do I hide those rows in parent whose child data view returns 0 rows after applying RowFilter on child
I've done it like this, but it feels like a nasty hack; I've never read the source deeply enough to know if there is a better way:
Add a column to your child datatable: Name: IsShowing, Type: Int, Expression: 1, ReadOnly: True
Put the following code:
ChildBindingSource.RemoveFilter()
ParentBindingSource.RemoveFilter()
YourDataSet.ChildDataTable.IsShowingColumn.Expression = ""
YourDataSet.ChildDataTable.Expression = $"IIF([SomeColumn] Like '{SomeFilterText}',1,0)"
ChildBindingSource.Filter = "[IsShowing] > 0"
ParentBindingSource.Filter = "Sum(Child.IsShowing) > 0"
The removal and re-add triggers a re-evaluation of the expression and the filters. There is probably a way to do this without removing/re-adding but I haven't yet found it.. Expressions are normally only re-evaluated when row data changes; changing an expression doesn't seem to recalculate all the row values/trigger a refresh of the relations and BS filters
It would be great if the parent filter supported complex expressions like SUM(IIF(Child.SomeColumn = 'SomeFilter',1,0)>0 but the SUM operator expects only a column name in the parent or child. As such, the circuitous route of having a column with an Expression be the part inside the SUM is the only way i've found to leverage the built in filtering
Remember when you test that the search is case sensitive. If you want it not to be you might have to have another column of data that is the lowercase version of what you want to search and lowercase your query string

How to pass multiple filters to jQuery datatable?

I have a jQuery dataTable which I use to search for a month like this:
table.column(1).search("February").draw();
I would like to pass 2 months as filter now but this does not work:
table.column(1).search(["Ferbrary", "March"]).draw();
Also, search returns an DataTables.API object as per the documentation - https://datatables.net/reference/api/search()
Is there anyway we can add 2 DataTables.API objects and invoke a draw() on the combination? I tried this and it didn't work:
filtered_table = table.column(1).search("February") + table.column(1).search("March");
filtered_table.draw();
This link jQuery DataTables filter rows based on multiple values says we can use a different function fnFilter instead of search to search multiple values using regex.
As per the suggestion in the above link, I tried these and none worked:
table.fnFilter("^February\$|^March\$", 1, true, false, false, false).draw();
table.fnFilter("February|March", 1, true, false, false, false).draw();
How do I achieve multiple value filters on the same column? Pls help!
You can use regular expressions with column().search() API method to search for multiple values in the same column.
For example:
table.column(1).search('February|March', true, false).draw();
See this example for code and demonstration.

Databricks getArgument value cannot be used within Spark SQL IN clause

I am getting a list of comma separated strings from a databricks notebook widget but I cannot use that value within Spark SQL's IN clause
I am within a %sql cell within the notebook and would like to NOT have to jump into %py or %scala cell type.
Also, I cannot use a select statement within the IN clause as the IN clause is NOT within a select filter. One gets an error: "IN/EXISTS predicate sub-queries can only be used in a Filter" if you try that syntax.
Here ITEM is a widget created like this in a %sql cell
CREATE WIDGET TEXT ITEM DEFAULT "'0111','0112'"
select *
from items_table
where ItemSKU in (string(getArgument("ITEM")));
or
select *
from items_table
where ItemSKU in (getArgument("ITEM"));
it does not return any rows
But if I directly substitute the value of the comma separated string in code, i.e.
select *
from items_table
where ItemSKU in ('0111','0112');
I get the expected result.
This is possible, try:
...
WHERE ItemSKU IN (SELECT explode(split(getArgument("ITEM"),',')))
This will also work for multi-select widgets.
The text widget option will be susceptible to user error if your users are allowed to enter text directly.
I don't think you can have multiple items as a default value of a multiselect widget, and definetely not a text widget.
If you look at the signature of the multiselect function
multiselect(name: String, defaultValue: String, choices: Seq, label: String)
You can see that the defaultValue only accepts a String while the choices is a Sequence. I know this is the scala function and you are lookign for the SQL version, but this implies that there is not meant to be a multiselect default option yet that actually has multiple selections.
Link - https://docs.databricks.com/user-guide/dev-tools/dbutils.html

dynamic multiple grouptext in jqgrid

I have implemented multiple grouping in jqgrid which is dynamic(can be on 1 or many columns). And I want the grouptext to have a checkbox, column name and the value.
$("#Grid").jqGrid({
...
grouping:true,
groupingView:{
...
grouptext:['<input type="checkbox" class="groupHeader"/> ColumnName: {0}']
})
This will give me grouptext in only one groupheader. But I can have grouping on several columns where the columnName is dynamic. I tried this which is not working:
var columnNames=['ABC','DEF','GHI'];
var grouptext1=['<input type="checkbox" class="groupHeader"/> columnNames: {0}']
$('#Grid').jqGrid('setGridParam',{grouptext:grouptext1})
I can change the grouptext1 according to my needs. But I need a way to bind it to the jqGrid.
How can that be done?
Note that you have a typo errr in your code. The JavaScript is case sensitive and you have write grouping text property not correct. It should be groupText instead of grouptext as you write.
If you can see, the groupingGroupBy method has a second parameter - options. That is exactley what you need. This parameter is a grouping options. Having this you can set the groupText. in a case you want like this
$("#grid").jqGrid('groupingGroupBy',
['col1','col2'],
{
groupText : [ 'checkbox for col1', 'checkbox for col2']
...
}
);

Extjs 4 Grid findcolumn

I search a way in extjs 4 to find grid columns dynamic, because i wrote a function to show errors in editor grid. In version 3 i've made it over
getColumnModel().findColumnIndex(cellname);
but column model no longer exists, does anybody has an idea?
Regards
I just had to work this out, #VoidMan was close. Need to specify the view though. For example:
If your column is configured with an itemId like this:
{
header: 'A Column',
dataIndex: 'data',
width: 70,
itemId: 'myColumnItemId'
}
You can call it like this:
grid.getView().getHeaderCt().child('#myColumnItemId')
This is something among these lines:
myGrid.headerCt.child('#column')
where #column its your column itemId. Note, use itemId and not id because columns are now Component and Component id must be unique across all your application.
Hope that helps.
take a look at Ext.grid.header.Container and Ext.view.Table.headerCt