GridFieldAddExistingAutocompleter searches only Title or Name of related classes

৮০টি ভিউ
প্রথম অপঠিত মেসেজটিতে চলে আসুন

baba-papa

পড়া হয়নি,
২২ সেপ, ২০১২, ৫:১২:০৩ AM২২/৯/১২
প্রাপক silverst...@googlegroups.com
I like the idea of adding relations with an autocomplete field.Our ecommerce module SilverCart often deals with large amounts of objects and the checkboxes of the ComplexTableField and its descendants weren't very user friendly.
However, the GridFieldAddExistingAutocompleter just searches the attributes 'Title' and/or 'Name' of the related object:
protected function scaffoldSearchFields($dataClass) {
$obj = singleton($dataClass); 
if($obj->hasDatabaseField('Title')) {
return array('Title');
} else if($obj->hasDatabaseField('Name')) {
return array('Name');
} else {
return null;
}
}
In case these fields do not exist the autocompleters request throws an exception.
I expected the autocompleter to use the information of the searchableFields() array. In SilverCart we often need to search the attributes of a further relation. For searchableFields() this was passible with dot-notation.
Should I provide a patch for this or is anyone still working on this issue?

Ingo Schommer

পড়া হয়নি,
২৬ সেপ, ২০১২, ৫:৫১:৪৯ AM২৬/৯/১২
প্রাপক silverst...@googlegroups.com
Hello Roland,

Yep, I think that's patch-worthy, since it kind of breaks developer expectations at the moment. 
If we have a thing called "searchable fields", it should be used consistently.

There's a couple of tickets around this

BTW: In case you encounter problems with dot notation,
those most likely need to be fixed in DataList and DataQuery, not in GridField itself.

Patch away! :)
Ingo

baba-papa

পড়া হয়নি,
২৭ সেপ, ২০১২, ৯:১১:৩৮ AM২৭/৯/১২
প্রাপক silverst...@googlegroups.com
Hello Ingo,

tanks for your answer. I wasn't aware of the tickets.
Sebastian and me are already working on this issue. We should be done by the end of next week.

Greetings,
Roland

baba-papa

পড়া হয়নি,
৪ অক্টো, ২০১২, ১০:২৫:৫৫ AM৪/১০/১২
প্রাপক silverst...@googlegroups.com
I finished my work on this issue, provided a pull request, unit testing and documentation.
সকলকে উত্তর দিন
লেখককে লিখে পাঠান
ফরওয়ার্ড করুন
0টি নতুন মেসেজ