PDA

View Full Version : Not allow double entrys in a grid column



Jacka
2 May 2007, 2:50 AM
Hello!

I have a little question about the editor grid.

My editor grid works very good! All field are able to alter and it is possable to insert a new dataset.
But...
I have a column with product numbers, witch must be unique in the column.
I would like to create an alert, after a user entered a existing product number.
So, how can do this?

I found the "findRecord" function, but how can i give the function a hole column and not only one value? :-/
Are there any other possabilitys?

Thanks a lot!!
Jacka

72
2 May 2007, 4:02 AM
In my mind if i will in your situation i will hook an event and check it with JSON against real data. Send request to script, script check with SQL query existance and script returns success or failed.

Just an idea..

jsakalos
2 May 2007, 4:02 AM
What about server side checking?

I just think that you may have many products (1000? more?) so sooner or later you would hit client's performance issue.

72
2 May 2007, 4:07 AM
What about server side checking?
I just think that you may have many products (1000? more?) so sooner or later you would hit client's performance issue.


Maybe u have right, but what do you think that Datastore do? Datastore checks cached data first but at second makes JSON request already and query database, so i think theres no other way to achieve this. And it is not great to store product codes at memory if there are too many records.

EDIT: I got it bad first so the answer is probably offtopic :)

jsakalos
2 May 2007, 4:14 AM
Yes, you're right if you have paging grid.

By server side checking I meant somethnig like hanging on keyup event with a buffer, sending request to server, checking response and taking appropriate actions in Ext (field valid/invalid, disable save button, whatever) based on the server response.

Jacka
2 May 2007, 4:30 AM
Server side.. of course, thats a good idea! Thank you!
Oh no.. yes, there are a lot of products in the database and i limit it of 20 dataset per page, so i can

jsakalos
2 May 2007, 4:33 AM
Exactly!

I'm glad I helped