Telerik Forums
KendoReact Forum
1 answer
69 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
910 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
208 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
181 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
1 answer
78 views

I am evaluating the KendoUI TreeView using this code snippet:

<TreeView
data={processTreeViewItems(workspaceGroups.current, {
select: select,
check: check,
expand: expand,
})}
focusIdField={"id"}
draggable={true}
expandIcons={true}
onExpandChange={onItemExpansionChanged}
aria-multiselectable={true}
onItemClick={onLayerItemClicked}
checkboxes={true}
onCheckChange={onItemCheckedChanged}
/>

I have declared a few constants and eventhandlers as follows:

function App() {


const [check, setCheck] = React.useState({
ids: ["100"],
idField: "id",
});
const [expand, setExpand] = useState({
ids: ["PROJECT WORKSPACES (5)", "Site Access Plan (8)"],
idField: "text",
});
const [select, setSelect] = useState({
ids: ["100"],
idField: "id",
});

I am having issues retrieving the correct value of the checked property from event.item in the onItemCheckedChange handler that looks like this:

const onLayerVisibilityChanged = (event: TreeViewCheckChangeEvent) => {

console.info("tree node checked or unchecked!!!")
const settings = {
singleMode: false,
checkChildren: true,
checkParents: false,
};

debugger

// if the UI checkbox is clicked, this value is false.

// if the checkbox is unclicked, this value is true. It seems to be delayed.

console.info(event.item.checked)

};

 

What am I missing?  I am using KendoUI TreeView 8.5.0.

Ina
Telerik team
 answered on 22 Oct 2024
1 answer
58 views

Hello,

We are migrating some of our bigger Grids to use the ASP.NET Core server-side helpers. On the TypeScript side of the code, with Kendo React, the Grid component is now using the DataResult object returned by the server endpoint.

One of our Grids needs to support row selection. I used to just do this manually using the described method on the documentation, which does not use DataResult. Is there a recommended way of doing selection when using DataResult? Or do I just modify the values field of the DataResult and add a selected field to each item, similar to without DataResult?

For reference, the structure of DataResult is just ...


/**
 * The result of the [process]({% slug api_kendo-data-query_process %}) method applied to a data structure.
 */
export interface DataResult {
    /**
     * The data that will be rendered by the Grid as an array.
     */
    data: any[];
    /**
     * The total number of records that are available.
     */
    total: number;
}

Konstantin Dikov
Telerik team
 answered on 22 Oct 2024
1 answer
52 views

Greetings,

I found an issue in the Monthly option where if I select the Sunday-Saturday from the second dropdown first, I'm unable to change the first dropdown. It only allows me to change the first dropdown if the second dropdown is day, weekday, or weekend day.
If I change the first dropdown to "third" and then the second dropdown to "Friday", the schedule that was created doesn't show up in the view (e.g "Third Friday")

Please help, thanks!

Yanko
Telerik team
 answered on 18 Oct 2024
1 answer
74 views

Hello,

We would like to use the Grid to show numbers.

We have a column named `Maximal value`, which only displays numbers.

We have already used the following features from the grid:

  • To sort the data correctly, we use the props `filter="numeric"` on the column
  • To align the numbers to the right, we use the grid Custom Cell

I found this question from 2019, which relates a lot to our requirements.

Is there a built-in column type "Number" in the grid which proposes all the built-in features regarding numbers?

We wouldn't like to miss on a built-in feature commonly used by the users, just because the Grid doesn't recognize the column as a number.

Something like type="numeric" in the column props.

Konstantin Dikov
Telerik team
 answered on 16 Oct 2024
1 answer
56 views

Hi

I am trying to set my dropdown menu from the dropdownbutton to appear to the left of the button.  Their is a property named dir of type string, which I am assuming does this but I cannot find the valid values for this property.  I have tried 'left'.

Any help would be appreciated.

Cheers

Simon

 

 

Vessy
Telerik team
 answered on 11 Oct 2024
1 answer
73 views

Hi, 

Does your team have an suggestions on how to go about linting Kendo elements?

My situation is that, Im using Kendo buttons inside a KendoForm to do things other than submit (which is the default button type in many browsers).  Best practice says that when using buttons, we hould always delcar the type (as button|submit|reset), but type is not a required attribute. 

I would like to lint my code to make sure taht any button declared has a type. Ths can be acheived on HTML buttons using @jsx-eslint/react/button-has-type rule, however it does not work on KendoButtons, but case those componetns are not HTML buttons.

The only other option i can think of is to extend the KendoButton into a custom component that requires the type attribute, and then only use my custom button interface (TypeScript).

Any thoughts?

Thanks,
Grant

Konstantin Dikov
Telerik team
 answered on 11 Oct 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?