mongoid 쿼리를 사용하여 MongoDB의 데이터를 표시하기 위해 부트 스트랩 테이블을 사용하고 있습니다. 5 분 간격으로 테이블을 새로 고침하고 싶습니다. 설명서를 읽었지만 Javascript를 처음 사용하는 사람은 Ajax 호출을 사용할지 아니면 setTimeout() 함수를 사용할지 여부를 모르겠습니다.부트 스트랩 테이블 새로 고침
이것은 내 테이블 코드입니다.
<table id="table" data-show-refresh="true" data-row-style="rowStyle" data-toggle="table" data-url="http://maccdx160121:4567/api/v1/currentsat*">
<thead>
<tr>
<th data-field="initials">Initials</th>
<th data-cell-style="cellStyle" data-field="sector">Sector</th>
<th data-field="cjs">CJS</th>
</tr>
</thead>
</table>
이 내 Mongoid 쿼리, 그것은 도움이되는 경우 : 어떤 도움
get '/currentsat*' do
#SatTransaction.where(current: true, :initials.ne => nil, :position.in => ["RDR", "SPVR", "OJI"]).to_json
SatTransaction.where(current: true, :shift_duration.ne => 0,).and(SatTransaction.or({:position.in => ["SPVR", "RDR", "OJI"]},{sector: "BREAK"}).selector).to_json
end
end
before do
cache_control :no_cache
end
def with_captured_stdout
old_stdout = $stdout
$stdout = StringIO.new('', 'w')
yield
$stdout.string
ensure
$stdout = old_stdout
end
감사합니다!
나는 당신이 무엇을하고 있는지 볼 생각 서버 데이터를 다시로드,하지만 난 내 코드에 통합하는 방법을 확실하지 오전 . Ajax 호출처럼 전문적이지는 않지만 필요한 자바 스크립트를 함께 만들 수있었습니다. – user2843365