How to set default value for FilteringSelect widget in Dojo Data Grid? - select

I am trying to display dynamic values read for a store as options within a filteringSelect widget in my DOJO Data Grid. The values are getting populated as expected however, I am unable to display a default value when the grid loads, right now it shows up as "..." on single click, I am able to see a drop down.
Below is the location of the sample code:
http://jsfiddle.net/R64bE/2/
I want to iterate through my "myStore" in the code above and make the item with label = 'Y' as the default for that filteringSelect.
I want the default value displayed as soon as the grid or filtering select is rendered. Any pointers or sample code will be of great help.

Glad that I was able to fixed it too..Below is the code in case anyone wants to achieve something similar.
Working code with Default value
Basically all I had to do was send a default value for that field/cell in the first json I created.
jsonStore = new dojo.data.ItemFileWriteStore({
data: {
"identifier": "identify",
"label": "description",
"items": [
{
"identify": 123,
"description": "Project Manager",
"billingMethod":"Sample"},
{
"identify": 234,
"description": "Developer"},
{
"identify": 536,
"description": "Developer"}
]
}
});
Notice that all I had to do was add a value for that column in the json, i.e., for Billing Method Column, I added "billingMethod":"Sample" and it picks it up from there.
Cheers

Related

whether devexpress GridControl Component can use the first column as index name

I'm new to Devexpress and windows desktop program,now I have to to dispaly the json data , below is the format
{
"op": "etf_info"
"data": {
"up_l": 100,
"down_l": 100,
"halt": 100,
"est_dif": 123,
“create_iopv”: 1.5991,
"create_limit": 100,
"redeem_iopv": 1.6992,
"redeem_num": 200,
}
}
and the name of each filed are required to be put at the first column, the next column display the data, because of the layout of components inside the mainform.
I'm trying GridControl but don't how to set it or whether it could word like that.
I do need your help~
you need to access gridview from gridcontrol like this:
GridView gridview = ((GridView) gridcontrol.FocusedView);
and use this loop
foreach (GridColumn item in gridView.Columns)
{
if (item == gridView1.Columns["<SomeColumnName>"])
{
//............
}
}
you can get more information in:
https://supportcenter.devexpress.com/ticket/details/t247992/how-to-find-a-column-in-the-gridcontrol
I hope you got help.
Thank you.

How do I define a custom snippet using VScode "Surround" extension

I'm using a VScode extension called "Surround"
In the docs for this extension it shows how to define a custom snippet. What I want is really simple. I would like to add the ability to surround selected text with tags, ie <> </> while placing the cursors in the middle where I define what type of tag that is (html, img, button, etc)
The docs show this example:
{
"surround.custom": {
// command name must be unique
"yourCommandName": {
// label must be unique
"label": "Your Snippet Label",
"description": "Your Snippet Description",
"snippet": "burrito { $TM_SELECTED_TEXT }$0", // <-- snippet goes here.
"languageIds": ["html", "javascript", "typescript", "markdown"]
},
// You can add more ...
}
}
I can almost parse it, except I don't know what the placeholders are representing. I assume { $TM_SELECTED_TEXT } is the text I've selected but what is the trailing $0 used for? Also, how can I place 2 cursors in between the opening and closing tags?
Thanks in advance.

acf_register_block_type did not show up in frontpage

I recently created a custom block type with acf like mentioned in the doc, it works just fine in the edit interface in the back-office, but in the front I did not get anything, and when i inspect the html code i get the content commented like this:
<!-- wp:acf/highlighted-posts { "id": "block_5e97574edd1fa", "name": "acf\/highlighted-posts", "data": { "titre": "", "_titre": "field_5e972e607d71e", "read_more": "", "_read_more": "field_5e973516c767d" }, "mode": "preview" } /-->
Any ideas please ! ?
For anyone who is facing this issue: you must use the WordPress Built in function the_content(), otherwise the content will not be parsed correctly. Or you can use the method parse_blocks(), more information’s in the following link :
https://developer.wordpress.org/reference/functions/parse_blocks/

In ag-grid, are status bars supported in the server side model?

I've created the following Plunkr:
https://plnkr.co/edit/UX7qeeul5SfWXtV9rYcf?p=preview
and have added the following code:
statusBar: {
statusPanels: [
{ statusPanel: 'agFilteredRowCountComponent' },
{ statusPanel: 'agSelectedRowCountComponent' },
{ statusPanel: 'agAggregationComponent' }
]
},
from:
https://www.ag-grid.com/javascript-grid-status-bar/#example-status-bar-simple
However, I am not getting status bars.
Are they supported in the server side model?
Seems that is an issue of default statusPanel.
Cuz I've checked with custom and it works, here is a sample
*check console, getRangeSelections and getSelectedRows works as expected, so you can try to create own statusPanel with same logic while it wouldn't be fixed.
I believe the issue with your specific example is that you are unable to actually select a ROW of data in your example. Instead you seem to only be able to select individual nodes. The status bar will only appear if an entire row is selected regardless on the data source
As well this is an excerpt from filterRowsComp.ts line 26 for within Ag grid:
// this component is only really useful with client side rowmodel
if (this.gridApi.getModel().getType() !== 'clientSide') {
console.warn(`ag-Grid: agFilteredRowCountComponent should only be used with the client side row model.`);
return;
}
Showing that the default filtered data status bar panels will only work correctly with client side data.

get date using Angular-UI Bootstrap Datepicker inside Modal opened from Grid cell

Maybe this is overkill, but I am trying to
1. open a Modal window, when a link is clicked in UI-Grid
can be done by modifying http://ui-grid.info/docs/#/tutorial/110_grid_in_modal
2. Put a (ui.bootstrap.datepicker) inside the Modal
3. Retrieve the chosen date
4. update the Date Cell in that UI-Grid Row
so, Is Ui-Grid 'well suited'/'can do this' given the above requirements
tia
Nope, not overkill. You can do this with UI-Grid pretty easily. There's a guide on how to do hook up modal editors using Angular Schema Form here: http://brianhann.com/create-a-modal-row-editor-for-ui-grid-in-minutes/ (caveat: I'm the author).
I've also created a new plunker that uses the angular-schema-form-datepicker library to show how you might do this: http://plnkr.co/edit/7t3BI2AUcnvNfav78Btr?p=preview
(plunker has been throwing 404s for files that are part of a plunk so you might have to refresh it)
The main things you have to do are set up your object schema:
scope.schema = {
"type": "object",
"properties": {
"myDate": {
"title": "My Date",
"type": "string",
"format": "date"
}
}
}
Using the same property as your column Defs:
columnDefs = [
{ field: 'myDate', name: 'My Date' }
]
And specify your date format in your form:
form = [
{
key: 'myDate',
format: 'yyyy-mm-dd'
}
]