Show only a maximum of items in a GridView - windows-phone-8

is there an easy way to show only a maximum size of items. For example I have a list with 20 items but in my GridView I want to show only 9. Is it possible? I have testet MaximumRowsOrColumns but that has no effect.
Thanx
newone

Something like the following should work
public IEnumerable<Object> Items
{
get
{
return _items.Take(9);
}
}

Related

Ag-grid column menu: display overflow text

By default Ag-grid sets a fixed column menu width. Their documentation has an example of setting the column menu width to a different fixed value. The issue with this approach is that every column will have the same menu width.
Is there a way to dynamically set the column menu width based upon the column's filter list values? The following has no effect:
.ag-set-filter-list {
width: auto;
}
Similarly word wrapping could also solve this issue, but is also not working:
.ag-set-filter-list {
overflow-wrap: break-word;
}
I also tried using the postPopup callback to adjust styling after rendering, with no luck:
created() {
this.postProcessPopup = (params) => {
if (params.type !== 'columnMenu') {
return;
}
params.ePopup.style.overflowWrap = "break-word";
params.ePopup.style.width = "auto";
}
}
Digging into Ag-grid's filter list styling more, I realized that the filter items are absolutely positioned and use top values for placement. This made it difficult to wrap filter values without having them collide with each other.
I contacted Ag-grid support and they confirmed that dynamic filter list widths are not supported. They did mention their tooltips feature though, which works for my use case.
I modified that example in two ways:
Only show tooltips for filter list values that are longer and will be cut off by the edge of the filter menu.
Only show tooltips for values in the filter list, not for rows in the grid.
Here's my version of a custom tooltip with the above modifications:
export class GridColumnFilterTooltip {
init(params) {
const FILTER_VALUE_CHARACTER_LIMIT = 28;
this.tooltip = document.createElement("div");
if (
params.location === "setFilterValue" &&
params.value.length > FILTER_VALUE_CHARACTER_LIMIT
) {
this.tooltip.classList.add("grid-column-filter-tooltip");
this.tooltip.innerHTML = params.value;
}
}
getGui() {
return this.tooltip;
}
}

Why is button not getting disabled using jQuery?

Let me clear first that I checked other answers. They're either too old or not working for me...
I am trying to dynamically disable and enable two navigation buttons using a function:
function arrowDisplayConfig() {
if (modeInSight == 1) {
$("#rightArrow").prop("disabled",false);
$("#leftArrow").prop("disabled",true);
}
if (modeInSight === maxModes) {
$("#rightArrow").prop("disabled",true);
$("#leftArrow").prop("disabled",false);
}
else {
$("#rightArrow").prop("disabled",false);
$("#leftArrow").prop("disabled",false);
}
}
Basically disabling left arrow when its the first item in carousel and right one when its the last item, while keeping both enabled when in-between.
The problem is that this works perfectly for all cases except the first one. Don't know why.
P.S
I increase and decrease the modeInSight integer value in other functions and call this function after it.

How to get multiple selected checkbox item from multiple checkbox list in angular

i have minimal reproduce here https://stackblitz.com/edit/angular-uwfsyv?file=app%2Fapp.component.html, there i have 2 array,checkboxesDataList and checkboxesDataList2 i successfully get the checked label from checkboxesDataList but that's just for an example.
but what i wanted to get in my project is similar to checkboxesDataList2 inside here i have object question and checkboxesDataList don't have that so this function
fetchSelectedItems() {
this.selectedItemsList = this.checkboxesDataList.filter((value, index) => {
return value.checked;
});
}
won't work immediately if i change this.checkboxesDataList to this.checkboxesDataList2 how can i make it work?
do you want to has a function like?
getDataChecked()
{
return this.checkboxesDataList2.question
.map(x=>x.options.filter(o=>o.checked))
.reduce((acc, value)=>[...acc,...value])
}

show and hide buttons/links based on ACL in cakephp 3

I want to hide the button/link based on ACO. Please help me how to do it in cakephp 3 as for cakephp2 we can do it by follow this link.
I need alternative of following for cakephp3:
public function index() {
// These all return true:
$this->Acl->check('warriors/Aragorn', 'Weapons');
$this->Acl->check('warriors/Aragorn', 'Weapons', 'create');
$this->Acl->check('warriors/Aragorn', 'Weapons', 'read');
}

Flex/Flash Builder - Copy/paste MULTIPLE rows from one dataGrid to another

I'm in need of help! Basically I have two mx DataGrids, one that pulls in data from an xml file and the other is blank because I'd like to add to it. I'm trying to select multiple rows from one grid and add them to the other by clicking a button.
Currently I'm successfully able to select, copy and paste one row, but no more. The allowMultipleSelection option is set to true, however when I select multiple rows and try to paste them into the empty dataGrid, it will only paste one row at a time.
Here's the function that I'm using to add the selected row to the empty datagrid.
public function handleAddRow(event:MouseEvent):void
{
summaryGrid.dataProvider.addItem({"Category": offersGrid.selectedItem.category,
"Program": offersGrid.selectedItem.program,
"Manufacturer": offersGrid.selectedItem.manufacturer,
"Products": offersGrid.selectedItem.products,
"MinimumOrder": offersGrid.selectedItem.minimumOrder,
"OfferDetail": offersGrid.selectedItem.offerDetail
});
}
Thanks in advance!
--Moe
use the selectedCells property instead selectedItem. This is a collection of Object which contain all the selected rows.
function handleAddRow(event:MouseEvent):void
{
for each(var row in offersGrid.selectedCells)
summaryGrid.dataProvider.addItem({
"Category": row.category,
"Program": row.program,
"Manufacturer": row.manufacturer,
"Products": row.products,
"MinimumOrder": row.minimumOrder,
"OfferDetail": row.offerDetail
});
}
Try with this and be sure this fields are in your grid.
function handleAddRow(event:MouseEvent):void
{
for each(var row in offersGrid.selectedCells)
summaryGrid.dataProvider.addItem({
category: row.category,
program: row.program,
manufacturer: row.manufacturer,
products: row.products,
minimumOrder: row.minimumOrder,
offerDetail: row.offerDetail
});
}
Actually you need to invoke addItem on all the selected items. Here is the code I have tried and it works fine:
public function handleAddRow(event:MouseEvent):void
{
var selectedItems:Array = offersGrid.selectedItems;
if(summaryGrid.dataProvider == null) summaryGrid.dataProvider = new ArrayCollection();
for each(var item:CategoryObject in offersGrid.selectedItems) {
(summaryGrid.dataProvider as ArrayCollection).addItem(item);
}
}
You may need to make any minor change as per your requirement. If you face any other issue drop a comment.