Telerik Forums
KendoReact Forum
4 answers
322 views

Hello,

 

I have a form (not KendoReact Form), and in this form i have Input field and under this component a have TabStrip with TabStripTab's. Each TabStripTab has own Input components. Some components are Required some not. 

If i Click Submit button,  the required components in TabStripTab are ignored, if i don't write values in components that are in TabStrips.

 

Is there any way i can also "check" required components in TabStrip on Submiting Form?

 

Thank you, Matjaz Reberc

n/a
Top achievements
Rank 1
Iron
 answered on 18 Feb 2021
2 answers
70 views

Hello. I am trying to create a filterable grid table. In our project, we are using React partly, meaning I need to import all my dependencies via script tag. I was following the Grid Component example in the docs but couldn't find a way to import process function from kendo-react-query library.

Code: import { process } from '@progress/kendo-data-query';

I need this as a script tag so that I can consume it through window object like this: window.KendoDataQuery.process

I already added all the recommended js script tags into my page but couldn't find this specific process function in the window object under any of the Kendo objects.

 

Help is appreciated. Thanks.

Stefan
Telerik team
 answered on 17 Feb 2021
2 answers
689 views

Hi

When we have combobox control in a form, it is not firing onChange event. It is firing onOpen event, but not onChange. I have tried FormComboBox and ComboBox inside Form, but both are failing.

 

Demo project: https://stackblitz.com/edit/react-combo-notfiring-onchange?file=app/main.jsx

Pranay
Top achievements
Rank 1
 answered on 11 Feb 2021
7 answers
2.5K+ views

I need to be able to rename a file before uploading (for example, to strip bad characters).  Simply renaming the file in any of the events doesn't work -- once it hits the actual upload mechanism, the filename goes back to the original name.

Thanks for any assistance!

Talin
Top achievements
Rank 1
 answered on 09 Feb 2021
1 answer
82 views

Hi Team, 

I've created a demo of my issue here, https://stackblitz.com/edit/react-kpchtb. Im trying to stack windows with their modal, but as you will see in the demo, opening the second window stacks its modal under both windows.

How can I stack it above preventing users from interacting with the first window? 

Thanks,
Grant

Stefan
Telerik team
 answered on 09 Feb 2021
2 answers
149 views

Hi,

I have multiple Upload components on a single page. First is for single file and second is with multiple files upload enabled. I need custom messages for "upload.select". One will be "Select single file" and other "Select multiple files" Is this possible?

Matej
Top achievements
Rank 1
Veteran
 answered on 05 Feb 2021
2 answers
408 views

Hi,

The KendoReact Upload control has a 'multiple' prop. According to the documentation, "If set to false, only one file can be selected at a time". However, setting this prop to false only prevents selection of multiple files via the Select Files button. Multiple files can still be selected by dragging and dropping. This behaviour can be seen in the cited Kendo example:

https://www.telerik.com/kendo-react-ui/components/upload/file-processing/#toc-upload-of-single-or-multiple-files

Is this a bug or intended behaviour? If this is intended behaviour, is there a workaround to prevent upload of multiple files on drag and drop?

Kind regards,

David

David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 04 Feb 2021
7 answers
1.3K+ views

Hi,

The KendoReact Upload component seems to only cater for sending files to dedicated server handlers. Is there any way to convert attached files to a byte array rather than posting to a server endpoint?

Kind regards,

David

Stefan
Telerik team
 answered on 02 Feb 2021
4 answers
1.2K+ views

i use Springboot for backend and database, front as react.

 

i want to use saveUrl in kendo-upload ui post my image to springboot and saving image in mysql db.

 

i have "uploadFile" variable as axios request parameter

 

 

@RestController
@CrossOrigin
public class MemberController {

@Autowired
MemberMapper mapper;


MultipartFile upload;
String photoname;

 

 

@PostMapping(value = "/member/upload", consumes = {"multipart/form-data"})
public Map<String, String> fileUpload(@RequestParam MultipartFile uploadFile, HttpServletRequest request){
String uploadPath = request.getSession().getServletContext().getRealPath("/WEB-INF/photo");
System.out.println(uploadPath);


int pos = uploadFile.getOriginalFilename().lastIndexOf("."); 
String ext = uploadFile.getOriginalFilename().substring(pos);


Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
photoname = "jeju" + sdf.format(date) + ext;

upload = uploadFile;

Map<String, String> map = new HashMap<String, String>();
map.put("photoname", photoname);
return map;
}

 

 

 

and 

for react

 

let uploadFile = null;

    imageUpload=(e)=>{
        const uploadFile = e.affectedFiles[0].name;
        
        const memberFile = new FormData();
        memberFile.append("uploadFile",uploadFile);
        axios({
            method: 'post',
            url: URL + '/member/upload',
            data: memberFile,
            headers: {'Content-Type':'multipart/form-data'}
        }).then(response=>{
            alert(response.data.photoname+" ==> save as this name");
            
            this.setState({
                photoname: response.data.photoname
            })
        }).catch(err=>{
            console.log("error while uploading images:"+err);
        })
    }

 

 

 onAdd = (event) => {
        const afterStateChange = () => {
            event.affectedFiles
                .filter(file => !file.validationErrors)
                .forEach(file => {
                    const reader = new FileReader();
                    reader.onloadend = (ev) => {
                        this.setState({
                            filePreviews: {
                                ...this.state.filePreviews,
                                [file.uid]: ev.target.result
                            }
                        });
                    };
                    reader.readAsDataURL(file.getRawFile());
                });
        };
        this.setState({
            files: event.newState,
            events: [
                ...this.state.events,
                `selected file: ${event.affectedFiles[0].name}`
            ],
        }, afterStateChange);
        uploadFile = event.affectedFiles[0].name;
    }

 

 

 

render(){

    return (

 <div>
                    <InputLabel id="demo-simple-select-label">picture</InputLabel>
                    <br />
                    <Upload 
                        batch={false}
                        multiple={true}
                        files={this.state.files}
                        onAdd={this.onAdd}
                        onRemove={this.onRemove}
                        onProgress={this.onProgress}
                        onStatusChange={this.onSatusChange}
                        withCredentials={false}
                        saveUrl={URL + '/member/upload'}
                        removeUrl={'https://demos.telerik.com/kendo-ui/service-v4/upload/remove'}
                        onChange={this.imageUpload.bind(this)}
                    />
                    <div className={'example-config'} style={{ marginTop: 20 }}>
                        <ul className={'event-log'}>
                            {
                                this.state.events.map(event => <li key={event}>{event}</li>)
                            }
                        </ul>
                    </div>
                    {
                        this.state.files.length ? 
                        <div className={'img-preview example-config'}>
                            <h3>image preview</h3>
                            {
                                Object.keys(this.state.filePreviews)
                                    .map((fileKey, index) => (<img 
                                        src={this.state.filePreviews[fileKey]} 
                                        alt={index}
                                        style={{ width: 200, margin: 10 }} 
                                    />))
                            }
                        </div> : undefined
                    }
                </div>

);

 

}

Stefan
Telerik team
 answered on 29 Jan 2021
2 answers
1.9K+ views
I have a Boolean column in my grid and I'm using cellRender to change the default true/false to Yes/No. How do I change the text displayed in the dropdown list of filtering options from (all), true, and false to All, Yes, and No?
Steve
Top achievements
Rank 1
 answered on 28 Jan 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?