Telerik Forums
KendoReact Forum
1 answer
37 views

Hi,

I'm working on a solution for my team's grid implementation. We need to prevent certain columns from being reordered into the last column position if that last column is designated as immovable. Is there a way to retrieve the target index of where a column is being moved to, so we can conditionally restrict reordering?

Thank you!

Konstantin Dikov
Telerik team
 answered on 12 Nov 2024
1 answer
61 views

Hi,

So, I realized that if I create a <Grid data={dataSource}></Grid>, without anything in between, it is smart enough to create all the columns for me. That is super awesome, since I have a dataset with 16 columns.

However, now that I need to customize the filterCell for a couple particular columns. How do I do that? I have two solutions

1/ It seems like if I create one GridColumn (to have filterCell attribute), I have to create all 16 of them.

2/ I can do a mapping function to create all the non-customized columns, but since the customized ones are not in sequential order, all the columns excluded from the mapping function will be placed at the end (right-most of the grid) - which is not ideal. 

Any help is greatly appreciated.

Best regards,

Luu

Yanko
Telerik team
 answered on 11 Nov 2024
1 answer
60 views
When I use dropdown and style border of popup, border top of popup is transparent and dropdown's bottom border transparent too. How can i change border of dropdown and popyp when popup change his position from bottom to top and opposite when I scroll content. Can I monitor change of popup of dropdown?
Yanko
Telerik team
 answered on 08 Nov 2024
1 answer
77 views

Hello,

I'm trying to create a pivot grid and I want to have all my equipment even if they have no data in the pivot grid but if I add a equipment with no employee there is a row with null in it. Is there a way of hidding the row if it has null or empty but still have the column with no data?

Here is an image of what I have

 

If that can help here is the data I have that populate the pivot grid

const data = [
    { inspectionId: 1, Equipment: "Test1", Employee: "emp1", nbInspection:5 },
    { inspectionId: 2, Equipment: "Test1", Employee: "emp2", nbInspection:3 },
    { inspectionId: 3, Equipment: "Test2", Employee: "emp3", nbInspection:2 },
    { inspectionId: 4, Equipment: "Test2", Employee: "emp1", nbInspection:3 },
    { inspectionId: 5, Equipment: "Test2", Employee: "emp2", nbInspection:2 },
    { inspectionId: 6, Equipment: "Test3", Employee: "emp3", nbInspection:5 },
    { inspectionId: 7, Equipment: "Test3", Employee: "emp2", nbInspection:2 },
    { inspectionId: 8, Equipment: "Test3", Employee: "emp2", nbInspection:1 },
    { inspectionId: 9, Equipment: "Test3", Employee: "emp1", nbInspection:3},
    { inspectionId: 10, Equipment: "Test4", Employee: null, nbInspection:0 },
    { inspectionId: 11, Equipment: null, Employee: "emp4", nbInspection: 0 },
];
Konstantin Dikov
Telerik team
 answered on 08 Nov 2024
1 answer
48 views

Hello;

We need to display a chart which shows the data we have from the backend. Each event has a date record that includes the milliseconds. It is very possible that we need to show several events that are only a few milliseconds apart.

I have managed to show the events per second, with this configuration only the last event we received for that second is shown, losing data in the chart.

If I configure the ChartCategoryAxisItem with baseUnit milliseconds, the web crashes and closes, it seems that it starts to calculate something and causes an error.

I attach the current development, it is quite simple.

Could you recommend the configuration of the components or tell us which components are recommended to use when working with dates that have milliseconds?

The idea is to show a series of events with dates with milliseconds in a chart.

Thanks in advance.

 

Event Example

{
    "idEvent": 551,
    "seqNumber": 0,
    "eventTime": "2024-05-16T23:59:48.200Z",
    "eventTimeQ": 1,
    "eventTimeLocal": 1,
    "quality": "1",
    "value": 30,
    "COT": null,
    "points_idPoint": 3,
    "DynamicTexts_idDynamicTexts": null
}

 



<Chart ref={chartRef} style={{ height: "100%" }}>
<ChartLegend position="top" visible />
<ChartTooltip
render={({ point }) => `${point.series.name}: ${point.value}`}
/>
<ChartCategoryAxis>
<ChartCategoryAxisItem
baseUnit="milliseconds"
baseUnitStep={100} 
min={new Date(startDate)}
max={new Date(endDate)}
majorGridLines={{ visible: true }}
title={{ text: "Event Time" }}
majorTicks={{ step: 5 }} // Muestra una etiqueta cada 5 puntos
labels={{ step: 5, rotation: "auto" }}
/>
</ChartCategoryAxis>
<ChartValueAxis>
<ChartValueAxisItem
name="digitalAxis"
title={{ text: "Digital" }}
min={0}
max={1}
labels={{ format: "{value}" }}
/>
<ChartValueAxisItem
name="analogAxis"
title={{ text: "Analog" }}
labels={{ format: "{value}" }}
/>
</ChartValueAxis>
<ChartSeries>
{signals
.filter((s) => s.visible)
.map((signal) => {
const events = chartData[signal.idPoint] || [];
return (
<ChartSeriesItem
key={signal.idPoint}
type="line"
data={events.map((event) => ({
value:
signal.idPointType <= 1
? event.state === "On"
? 1
: 0
: event.value || 0,
category: event.eventTime,
}))}
color={signal.color}
name={signal.tag}
axis={signal.idPointType <= 1 ? "digitalAxis" : "analogAxis"}
/>
);
})}
</ChartSeries>

</Chart>

Ina
Telerik team
 answered on 07 Nov 2024
1 answer
48 views

Not seeing this in the docs, but wondering if there's a feature in planning to allow highlighting of an area on a PDF, and target a certain page. 

This feature exists in another library (React PDF Viewer), but it's no longer maintained.  Any plans for KendoReact?  Thank you.

Vessy
Telerik team
 answered on 06 Nov 2024
1 answer
55 views

Hello,

I would like to add a custom render for the GroupPanel component, or at the very least, obtain its ref to insert additional elements according to our design requirements (a non-functional div: "Group by:", "Drop column here"). Is this possible?

Example: 

Thank you in advance for your help!

Best regards,
Vsevolod

Ina
Telerik team
 answered on 05 Nov 2024
3 answers
848 views

Hello,

 

ist it possibel to set up the DatePicker so that the week starts wit MONDAY and not Sunday?

Thank you, Matjaz Reberc

JeffSM
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 29 Oct 2024
1 answer
134 views
Hello!

I was looking over the documentation and previous answers, and I have a scenario that I can seem to find an answer for. I've been assigned a task to update the filter drop down which includes the options of "Is null", "Is not null", "Is empty", "Is not empty".  We have some non-technical people that don't really understand was 'Is null' means, and the difference between null and empty, so i'm trying to update these filters values.

The solution I would like to implement into the grid is to have the filter operators defined below.


const filterOperators = {
        text: [
          {
              text: "grid.filterContainsOperator",
              operator: "contains"
          },
          {
              text: "grid.filterNotContainsOperator",
              operator: "doesnotcontain"
          },
          {
              text: "grid.filterEqOperator",
              operator: "eq"
          },
          {
              text: "grid.filterNotEqOperator",
              operator: "neq"
          },
          {
              text: "grid.filterStartsWithOperator",
              operator: "startswith"
          },
          {
              text: "grid.filterEndsWithOperator",
              operator: "endswith"
          },
          {
              text: "Is Blank", // Custom text for "Is Blank"
              operator: "isempty, isnull"
          },
          {
              text: "Is Not Blank", // Custom text for "Is Not Blank"
              operator: "isnotempty, isnotnull"
          }
      ]
    };
    
I would like to have two custom operators in the drop down called "Is blank" and "Is not blank", which would implement two operators each. 

Is this possible?
Vessy
Telerik team
 answered on 28 Oct 2024
2 answers
117 views

Hi,

I used the grid incell editing exemple ( https://www.telerik.com/kendo-react-ui/components/grid/editing/editing-in-cell/ ) to do modification in a list. The only thing I add to the exemple was the onBlur in the rowRender, because the exitEdit was not called anywhere.

Now I have a problem, because I have a delete button at the end of my row and if I click on it when i'm in edit the onClick event of my button is not called only the onBlur is called and I can't figure out what i'm doing wrong.

here is my custom row/cell render that I modified (I put the modification in bold)

import * as React from "react";
export const CellRender = (props) => {
    const dataItem = props.originalProps.dataItem;
    const cellField = props.originalProps.field;
    const inEditField = dataItem[props.editField || ""];
    const additionalProps =
        cellField && cellField === inEditField
            ? {
                ref: (td) => {
                    const input = td && td.querySelector("input");
                    const activeElement = document.activeElement;
                    if (
                        !input ||
                        !activeElement ||
                        input === activeElement ||
                        !activeElement.contains(input)
                    ) {
                        return;
                    }
                    if (input.type === "checkbox") {
                        input.focus();
                    } else {
                        input.select();
                    }
                },
            }
            : {
                onClick: () => {
                    props.enterEdit(dataItem, cellField);
                },
            };
    const clonedProps = {
        ...props.td.props,
        ...additionalProps,
    };
    return React.cloneElement(props.td, clonedProps, props.td.props.children);
};
export const RowRender = (props) => {
    const trProps = {
        ...props.tr.props,
        ...{
            onBlur: (e) => {
                    props.exitEdit()
            }
        }
    };
    return React.cloneElement(
        props.tr,
        {
            ...trProps,
        },
        props.tr.props.children
    );
};


and here is the code for the components

const removeCell = (props) => {
    const { dataItem } = props;
    return (
        <td className="k-command-cell">
            <Button onClick={() => delete(dataItem)}><span className="k-icon k-font-icon k-i-close-outline k-icon-xl redIcon"></span></Button>
        </td>
    );
}

const customCellRender = (td, props) => (
    <CellRender
        originalProps={props}
        td={td}
        enterEdit={(dataItem, field) => setState(enterEdit(list, dataItem, field))}
        editField={EDIT_FIELD}
    />
);
const customRowRender = (tr, props) => (
    <RowRender
        originalProps={props}
        tr={tr}
        exitEdit={() => setState(exitEdit())}
        editField={EDIT_FIELD}
    />
);

const enterEdit = (list, dataItem, field) => {
    return list.map((item) => ({
        ...item,
        [EDIT_FIELD]: item.id=== dataItem.id? field : null,
    }));
};

const exitEdit = () => {
    return list.map((item) => ({
        ...item,
        [EDIT_FIELD]: null,
    }));
};

And here is my grid

<Grid
    data={list}
    dataItemKey={"id"}
    total={list.length}
    cellRender={customCellRender}
    rowRender={customRowRender}
    onItemChange={itemChange}
    editField={EDIT_FIELD}
>
    <GridToolbar>
        <Button onClick={AddNewItem}><span className="k-icon k-font-icon k-i-plus-circle k-icon-xl greenIcon"></span> Add</Button>
    </GridToolbar>
    <Column field="Name" title="Name" editable={true} />
    <Column title="Delete" cells={{ data: removeCell, }} width="100px"></Column>
</Grid>

Thanks you for your help.

Mikael
Top achievements
Rank 1
Iron
 updated answer on 24 Oct 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?