2017-06-08 4 views
0

フィルタボタンを使用せずに、フィルタフォームのリストを表示するにはadmin-on-restを使用しようとしています。私はドキュメンテーションに従って、 "context = 'form'"パラメータをフィルタに追加しました。私はこの例外を受け取ります:admin-on-rest - ボタンなしのフィルタフォームのリストを表示

編集:私は提案されたalwaysOnを追加し、フォームコンポーネントは2回レンダリングされます。添付のスクリーンショットを参照してください。

enter image description here

proxyConsole.js:56 Warning: Failed prop type: The prop `hideFilter` is marked as required in `FilterForm`, but its value is `undefined`. 
in FilterForm (created by Form(FilterForm)) 
in Form(FilterForm) (created by Connect(Form(FilterForm))) 
in Connect(Form(FilterForm)) (created by ReduxForm) 
in ReduxForm (created by getContext(ReduxForm)) 
in getContext(ReduxForm) (created by Filter) 
in Filter (at index.js:31) 
in CommandFilter (at index.js:49) 
in div (created by CardActions) 
in CardActions (created by onlyUpdateForKeys(Actions)) 
in onlyUpdateForKeys(Actions) (created by List) 
in div (created by Card) 
in div (created by Paper) 
in Paper (created by Card) 
in Card (created by List) 
in div (created by List) 
in List (created by getContext(List)) 
in getContext(List) (created by Connect(getContext(List))) 
in Connect(getContext(List)) (at index.js:49) 
in CommandList (created by Route) 
in Restricted (created by Connect(Restricted)) 
in Connect(Restricted) (created by Route) 
in Route (created by CrudRoute) 
in Switch (created by CrudRoute) 
in CrudRoute (created by Route) 
in Route (created by AdminRoutes) 
in Switch (created by AdminRoutes) 
in AdminRoutes (created by Layout) 
in div (created by Layout) 
in div (created by Layout) 
in div (created by Layout) 
in div (created by Layout) 
in MuiThemeProvider (created by Layout) 
in Layout (created by WithWidth) 
in EventListener (created by WithWidth) 
in WithWidth (created by Connect(WithWidth)) 
in Connect(WithWidth) (created by Connect(Connect(WithWidth))) 
in Connect(Connect(WithWidth)) (created by Route) 
in Route (created by Admin) 
in Switch (created by Admin) 
in div (created by Admin) 
in Router (created by ConnectedRouter) 
in ConnectedRouter (created by Admin) 
in TranslationProvider (created by withContext(TranslationProvider)) 
in withContext(TranslationProvider) (created by Connect(withContext(TranslationProvider))) 
in Connect(withContext(TranslationProvider)) (created by Admin) 
in Provider (created by Admin) 
in Admin (at App.js:37) 
in App (at index.js:16) 
+0

私はあなたが提案しませフィルタのURLを使用するかは、ユーザーとの対話が必要なのか、私はあなたを理解すると思いますか? – rigobcastro

+0

あなたは何を意味するのか分かりません。申し訳ありません... – barisdad

+0

ご迷惑をおかけして申し訳ありません。私のポイントは、URLを使って直接フィルタリングできるということです。https://github.com/marmelab/admin-on-rest-demo/blob/master/src/categories/LinkToRelatedProducts.js – rigobcastro

答えて

0

私の間違いは「context = form」です。私はただすべてのフィールドをalwaysOnに設定する必要があります。これで正しくレンダリングされ、エラーはなくなりました。

ありがとう、wesley6j!

https://github.com/marmelab/admin-on-rest/issues/750

1

あなたはボタンを、あなたはフィルタのオプションalwaysOnを設定することができますドキュメントhttps://marmelab.com/admin-on-rest/Tutorial.html#filtersのようにフィルタの追加を意味します。

const ClientFeedbackFilter = (props) => (
    <Filter {...props}> 
    <CheckboxGroupInput source="read" choices={[ 
     { id: 'true', name: 'Read' }, 
     { id: 'false', name: 'Unread' }, 
    ]} alwaysOn /> 
    <TextInput source="by_content" alwaysOn /> 
    </Filter> 
); 
+0

alwaysOnとallを追加しましたコンポーネントは2回レンダリングされます。私は元の質問を編集します。 – barisdad

+0

@barisdadちょうどあなたがそれを2回置く場所を検索しようとします。私はおそらくApp.jsにあると思う – Alexey

関連する問題