Dojo Filtering Select Filtering - dojo

Is there a way to include the entire value in the filtering search? For example, searching “123″ would return the value “Test 123″. By default, the control only filters starting with the first character.
I tried modifying the queryExpr property mentioned here, but nothing seemed to work for me. Thanks for any tips.

I realise this is 2 years ago but I'm just answering in case someone else comes along looking!
You can specify the queryExpr like this:
<xe:djFilteringSelect id="djFilteringSelect1" value="#{viewScope.myvalue}" autoComplete="false">
<xe:this.queryExpr><![CDATA[${javascript:"*$\{0}*"}]]></xe:this.queryExpr>
<xp:selectItems id="selectItems1" value="#{myBean.mySelectItems}"/>
</xe:djFilteringSelect>

Related

Using datepicker in DotNetNuke-7 module

I'm a DNN beginner. I am currently building a module in which I can display statistics. My DotNetNuke Version is 7.0. The statistic is from Chartjs. For this statistic I would like to implement filters. These filters should be datepickers. As UI element I have now included a textbox with TextMode='Date'. But currently I have problems to set the default value of this field. The default value should be 01.01. of the current year.
I have already tried to set the value via C# server side. Unfortunately without success. I also tried to set the value on the client side via JavaScript. Unfortunately also without success.
These are some lines I tried in JavaScript:
document.getElementById(<%= this.DatumVon.AccessKey %>).value = "01.01.2019";
document.getElementById(<%= this.DatumVon.AccessKey %>).innerText = "01.01.2019";
document.getElementById("DatumVon").value = "01.01.2019";
These are some lines I tried in C# in the method "Page_Load" (server side):
this.DatumVon.Text = "01.01.2019";
I expected the value of the TextBox to be 01.01.2019. However, it currently only contains dd.mmm.yyyy. How can I change this?
Thank you.
There is something wrong with your localization. Please refer to the jQuery UI datepicker documentation (the "Localization" section), this should give you the answer.
wow... I solved it. I made it. Sometimes the solution is right in front of you and you don't see it. Michael Tobisch was absolutely right. When setting the value, the format is very important. I have always used the German format. A DNN TextBox with TextMode="Date" can't handle that. DNN converts this TextBox into an HTML input field. But this input field can only be clear with the format "yyyy-mm-dd". Depending on the geographical position of the client (at least that's what I think) the text displayed in the input field will be formatted. But the value of the input field always has the same format ("yyyy-mm-dd"). So very important here: the displayed text and the actual value have different formats.
Many thanks again to Michael Tobisch for the mental inspiration and the patience with me.
What is also important is that the access to the actual ID of a DNN element works as follows: this.Element.ClientID and not as I assumed before this.Element.AccessKey. This was also buggy.

JQl - how to find linked issues in an issue

Iam looking for the Jira JQL syntax, to find the linked-issues in an Issue. For example in Bug-issue i need to have in my report the linked-issues to my Bug-issue!
Thanks
If I understand your question well, you are looking for a JQL that will fetch you all the bugs that are LINKED to that specific bug!!! Considering this is what you're asking, here is the solution for that:
You'll need to create a filter as like what is shown below, and name this filter as MyFilter:
issuetype = Bug AND issuekey = ABC-12345
Then you will have to use this filter in the next filter to get all the linked issues (bugs) to the current bug:
issuetype in (Bug) and issueFunction in linkedIssuesOf('filter = MyFilter')
Using the second filter, you should be getting all the linked bugs to the original bug.
Hope this helps!

Formatting SQL Query Inside an IPython/Jupyter Notebook

I want to show some SQL queries inside a notebook. I neither need nor want them to run. I'd just like them to be well formatted. At the very least I want them to be indented properly with new lines, though keyword highlighting would be nice too. Does a solution for this exist already?
If you set the cell as Markdown one you can write the sql query as code specifying the language (e.g. mysql)
``` mysql
SELECT *
FROM table_a AS a
LIMIT 10;
```
This produces:
It highlights the keywords. Unfortunately, it doesn't seem to deal with indentation which seems to be the main issue you are trying to deal with but maybe this helps.
If you - like me - find yourself here because you want to highlight (and run) the %%sql magic, you're best of with the technique of this answer. Posting it here cause it took me quite some time before I found the correct keywords to my answer :)
require(['notebook/js/codecell'], function(codecell) {
codecell.CodeCell.options_default.highlight_modes['magic_text/x-mssql'] = {'reg':[/^%%sql/]} ;
Jupyter.notebook.events.one('kernel_ready.Kernel', function(){
Jupyter.notebook.get_cells().map(function(cell){
if (cell.cell_type == 'code'){ cell.auto_highlight(); } }) ;
});
});
I found that this fixed the issue I was having.
``` sql
Produced styled code in edit mode but not when the cell was run.
``` mysql
Produced correct styling

Elasticsearch search analyzer

I am playing with indexing an articlenumber in Elasticsearch.
Here i provide a working example:
https://found.no/play/gist/557202b3542be157d813
i dont understand why i get a different score if i change the value for "product_number.search"
if i change the value from "ak454" to "ak 454" the score changes.
i thought that if i am using a search_analyzer the value "ak 454" will be transformed to "ak454" (its mapped using the searchable_id).
you can also look at the analyses tab to see my tokenizer:
https://found.no/play/gist/557202b3542be157d813#analysis
thanks.
The term-query (and filter) does not do any text analysis.
The match-query does, and can achieve what you want.
I adapted the example: https://found.no/play/gist/2de967d844c5fbc14d2f
Setting explain to true is very useful when working with problems like this, as you see exactly what Lucene is doing when it's scoring.

Remove everything after string

I have a table with a field that contains descriptions for items sold on my site.
In our infinite wisdom, when we first started the site, we pasted code for a Facebook Like button into the description, each just a little different, as it has product info in the link. We now have about 400 items with the code in it.
This is an example of what I'm dealing with:
-Whipped Up, Fluffy Chocolate-On-Chocolate Taste; A Lighter Way To Enjoy Chocolate
- 45% Less Fat < iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.oursite.com%2Findex.php%3Fmain_page%3Dproduct_info%26cPath%3D33_36%26products_id%3D106&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80"
scrolling="no" frameborder="0" style="border:none; overflow:hidden;
width:450px; height:80px;" allowTransparency="true">< /iframe>
I want to remove the <iframe and everything past it. I have been looking around for examples using REPLACE and/or LEFT, but can't find what I need, as I am not very well versed in SQL language.
It will always be at the end of the products_description field, so I don't need to worry about saving anything past it, only before it.
The best I can come up with is
SELECT LEFT(REPLACE('<iframe%','<iframe%',' '),0)
but that doesn't seem to work.
Thank you for any help you can offer on this, as it will take me much less time than editing each description.
UPDATE: Still haven't found an answer, after trying many variations of what has been suggested. It runs, but makes no edit to the column.
I also tried this, after finding it on another site. The same, but thought it might give someone an idea of how to proceed:
select left(`products_description`,instr('<iframe',`products_description`)-1) FROM products_description
SELECT
trim( -- trim removes spaces before and after given string
left(
'some text < iframe',
locate('< iframe', 'some text < iframe') - 1
)
);
For better understanding i did not removed space between < and iframe.
You may also take a look at this thread:
Remove HTML tags from record
but this is discussion about removing tags only, and keeping <tag>text</tag> between tags. Anyway it will for for you, because you have nothing between <iframe> and </iframe>.
REPLACE('<iframe%','<iframe%',' ') will give you just ' ' - it searches first argument for second argument and replaces it with third.
LEFT(somestring, 0) will give you 0 characters string
Try this:
select substr(your_raw_string, 0, instr(your_raw_string, '<iframe') -1)
from your_table