brilliant-orangeB
Refine2y ago
15 replies
brilliant-orange

why not useTable search after data update?

export default function PointList() {
  const { tableQueryResult, pageCount, pageSize, current, setCurrent } = useTable({
    resource: "points",
    pagination: {
        current: 1, 
        pageSize: 10,
    },
  });

const { register, handleSubmit, control, reset } = useForm<BaseRecord, HttpError, IPointsFilterVariables>({
  
    defaultValues: {
      q: getDefaultFilter('q', filters, 'eq'),
      points: getDefaultFilter('points', filters, 'eq'),
    },
  })

<CardContent sx={{ pt: 0 }}>
            <Box
              component="form"
              sx={{ display: 'flex', flexDirection: 'column' }}
              autoComplete="off"
              onSubmit={handleSubmit(search)}
            >
              <Box mb={2}>
                <TextField
                  {...register('q')}
                  label={'검색'}
                  placeholder={'주문번호, 주문상태, 주문자, 상품명 등'}
                  margin="normal"
                  fullWidth
                  autoFocus
                  size="small"
                  variant="outlined"
                />
              </Box>
             
              <Box display="flex" justifyContent="space-between" width="200px">
                <Button type="submit" variant="contained">
                  검색하기
                </Button>
                <Button type="button" variant="contained" color="secondary" onClick={() => resetForm()}>
                  초기화
                </Button>
              </Box>
            </Box>
          </CardContent>
Was this page helpful?